当前位置: 首页>>代码示例>>C#>>正文


C# Spreadsheet.Normalize方法代码示例

本文整理汇总了C#中SS.Spreadsheet.Normalize方法的典型用法代码示例。如果您正苦于以下问题:C# Spreadsheet.Normalize方法的具体用法?C# Spreadsheet.Normalize怎么用?C# Spreadsheet.Normalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SS.Spreadsheet的用法示例。


在下文中一共展示了Spreadsheet.Normalize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestConstructor

        public void TestConstructor()
        {
            //just some stuff with filewriting
            Assert.IsTrue(sheet1.IsValid("any old string"));
            Assert.IsTrue(sheet1.Normalize("dead") == "dead");
            Assert.IsTrue(sheet1.Version == "default");

            //test 3 arg constructor
            sheet1 = new Spreadsheet(s => (s.Length >= 2) ? true : false,
                s => s.Replace(" ", ""),
                "version1");
            Assert.IsTrue(sheet1.IsValid("A1"));
            Assert.IsFalse(sheet1.IsValid("A"));
            Assert.IsTrue(sheet1.Normalize("d e a d") == "dead");
            Assert.IsTrue(sheet1.Version == "version1");
            sheet1.SetContentsOfCell("A     1","loaded!");

            string savePath = "save 1.xml";
            sheet1.Save(savePath);
            sheet1 = new Spreadsheet(
                savePath,
                s => (s.Length >= 2) ? true : false,
                s => s.Replace(" ", ""),
                "version1");
            Assert.AreEqual("loaded!",(string)sheet1.GetCellContents("A1"));
        }
开发者ID:jiiehe,项目名称:cs3500,代码行数:26,代码来源:SpreadsheetTests.cs

示例2: SpreadsheetFourArgumentConstructorTest

 public void SpreadsheetFourArgumentConstructorTest()
 {
     if (!File.Exists("fourarg.xml"))
     {
         Spreadsheet old = new Spreadsheet(TestValidToTrue, TestNormalizeToUpperCase, "2.2");
         old.SetContentsOfCell("A1", "asdf");
         old.SetContentsOfCell("B2", "23");
         old.Save("fourarg.xml");
     }
     Spreadsheet s = new Spreadsheet("fourarg.xml", TestValidToTrue, TestNormalizeToUpperCase, "2.2");
     Assert.AreEqual(true, s.IsValid("a"));
     Assert.AreEqual("A", s.Normalize("a"));
     Assert.AreEqual("asdf", s.GetCellContents("A1"));
     Assert.AreEqual(23.0, s.GetCellContents("B2"));
     Assert.AreEqual(23.0, s.GetCellValue("B2"));
     Assert.AreEqual("2.2", s.Version);
 }
开发者ID:Buck417,项目名称:Second-Half-CS-3500,代码行数:17,代码来源:SpreadsheetTests.cs

示例3: SpreadsheetThreeArgumentConstructorTest

 public void SpreadsheetThreeArgumentConstructorTest()
 {
     Spreadsheet s = new Spreadsheet(TestValidToFalse, TestNormalizeToUpperCase, "1.1");
     Assert.AreEqual(false, s.IsValid("a"));
     Assert.AreEqual("A1", s.Normalize("a1"));
     Assert.AreEqual("1.1", s.Version);
 }
开发者ID:Buck417,项目名称:Second-Half-CS-3500,代码行数:7,代码来源:SpreadsheetTests.cs

示例4: SpreadsheetTest

 public void SpreadsheetTest()
 {
     Spreadsheet s = new Spreadsheet();
     Assert.AreEqual("a", s.Normalize("a"));
     Assert.AreEqual(true, s.IsValid("a"));
     Assert.AreEqual("default", s.Version);
 }
开发者ID:Buck417,项目名称:Second-Half-CS-3500,代码行数:7,代码来源:SpreadsheetTests.cs


注:本文中的SS.Spreadsheet.Normalize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。