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


C# Spreadsheet.GetCellContents方法代码示例

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


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

示例1: SetStringContentTwice

 public void SetStringContentTwice()
 {
     Spreadsheet sheet = new Spreadsheet();
     sheet.SetCellContents("A1", "blue");
     sheet.SetCellContents("A1", "green");
     Assert.AreEqual(sheet.GetCellContents("A1"), "green");
     Assert.AreNotEqual(sheet.GetCellContents("A1"), "blue");
 }
开发者ID:drewmacmac,项目名称:old_class,代码行数:8,代码来源:UnitTest1.cs

示例2: GetValueFormula01

 public void GetValueFormula01()
 {
     Spreadsheet sheet = new Spreadsheet(s => true, s => s, "default");
     sheet.SetContentsOfCell("D1", "=5");
     Assert.AreEqual(sheet.GetCellContents("D1"), new Formula("5"));
     Assert.AreEqual(sheet.GetCellValue("D1"), (double)5);
 }
开发者ID:drewmacmac,项目名称:old_class,代码行数:7,代码来源:PS5Tester.cs

示例3: GetValueDoubleEmptyConstructor

 public void GetValueDoubleEmptyConstructor()
 {
     Spreadsheet sheet = new Spreadsheet();
     sheet.SetContentsOfCell("D1", "5");
     Assert.AreEqual(sheet.GetCellContents("D1"), (double)5);
     Assert.AreEqual(sheet.GetCellValue("D1"), (double)5);
 }
开发者ID:drewmacmac,项目名称:old_class,代码行数:7,代码来源:PS5Tester.cs

示例4: GetCellContentsDoubleCellExistsTest

 public void GetCellContentsDoubleCellExistsTest()
 {
     Spreadsheet s = new Spreadsheet();
     Assert.AreEqual(true, s.SetContentsOfCell("a1", "2.0").Contains("a1"));
     Assert.AreEqual(true, s.SetContentsOfCell("a1", "5.3").Contains("a1"));
     Assert.AreEqual(5.3, s.GetCellContents("a1"));
 }
开发者ID:Buck417,项目名称:Second-Half-CS-3500,代码行数:7,代码来源:SpreadsheetTests.cs

示例5: TestEmptyGetCellContents

        public void TestEmptyGetCellContents()
        {
            Spreadsheet sheet = new Spreadsheet();
            object content = sheet.GetCellContents("A1");

            Assert.IsTrue(content.Equals(""));
        }
开发者ID:HeroOfCanton,项目名称:CS3500,代码行数:7,代码来源:UnitTest1.cs

示例6: GetCellContentsStringCellExistsTest

 public void GetCellContentsStringCellExistsTest()
 {
     Spreadsheet s = new Spreadsheet();
     Assert.AreEqual(true, s.SetContentsOfCell("a1", "Hey there").Contains("a1"));
     Assert.AreEqual(true, s.SetContentsOfCell("a1", "What's up?").Contains("a1"));
     Assert.AreEqual("What's up?", s.GetCellContents("a1"));
 }
开发者ID:Buck417,项目名称:Second-Half-CS-3500,代码行数:7,代码来源:SpreadsheetTests.cs

示例7: GetCellContentsStringTest

 public void GetCellContentsStringTest()
 {
     //Gets the contents of a string-type cell
     Spreadsheet s = new Spreadsheet();
     s.SetContentsOfCell("a1", "Hey there");
     Assert.AreEqual("Hey there", s.GetCellContents("a1"));
 }
开发者ID:Buck417,项目名称:Second-Half-CS-3500,代码行数:7,代码来源:SpreadsheetTests.cs

示例8: 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

示例9: GetCellContentsFormula

        public void GetCellContentsFormula()
        {
            Spreadsheet sheet = new Spreadsheet();
            sheet.SetCellContents("A1", "blue");
            sheet.SetCellContents("A1", "green");
            sheet.SetCellContents("B1", "purple");
            sheet.SetCellContents("C1", "red");
            sheet.SetCellContents("D1", new Formula("C1 + 2 + X1"));

            Assert.AreEqual(sheet.GetCellContents("D1"), new Formula("C1+2+X1"));
        }
开发者ID:drewmacmac,项目名称:old_class,代码行数:11,代码来源:UnitTest1.cs

示例10: TestConstructor1

 public void TestConstructor1()
 {
     AbstractSpreadsheet sheet = new Spreadsheet();
     Assert.AreEqual("", sheet.GetCellContents("A1"));
     Assert.AreEqual("", sheet.GetCellContents("B1"));
     Assert.AreEqual("", sheet.GetCellContents("D1"));
     Assert.AreEqual("", sheet.GetCellContents("AA1"));
     Assert.AreEqual("", sheet.GetCellContents("Jim"));
     Assert.AreEqual("", sheet.GetCellContents("ab1"));
 }
开发者ID:Leyalic,项目名称:PS6_2015,代码行数:10,代码来源:SpreadsheetTests.cs

示例11: CreateSaveLoadSpreadsheet

 public void CreateSaveLoadSpreadsheet()
 {
     Spreadsheet sheet = new Spreadsheet();
     sheet.SetContentsOfCell("D1", "=5");
     sheet.SetContentsOfCell("C1", "=4.5");
     sheet.SetContentsOfCell("E1", "apples");
     sheet.SetContentsOfCell("G1", "-2");
     sheet.SetContentsOfCell("H1", "-4");
     sheet.SetContentsOfCell("F1", "= G1 + H1");
     sheet.Save(@"MyXml2.xml");
     Spreadsheet sheet2 = new Spreadsheet(@"MyXml2.xml", s => true, s => s, "default");
     Assert.AreEqual(sheet2.GetCellContents("D1"), new Formula("5"));
     Assert.AreEqual(sheet2.GetCellContents("C1"), new Formula("4.5"));
     Assert.AreEqual(sheet2.GetCellContents("E1"), "apples");
     Assert.AreEqual(sheet2.GetCellContents("G1"), (double)-2);
     Assert.AreEqual(sheet2.GetCellContents("H1"), (double)-4);
     Assert.AreEqual(sheet2.GetCellContents("F1"), new Formula("G1 + H1"));
     Assert.AreEqual(sheet2.GetCellValue("F1"), (double)-6);
 }
开发者ID:drewmacmac,项目名称:old_class,代码行数:19,代码来源:PS5Tester.cs

示例12: NormalizeTest1

 public void NormalizeTest1()
 {
     AbstractSpreadsheet s = new Spreadsheet();
     s.SetContentsOfCell("B1", "hello");
     Assert.AreEqual("", s.GetCellContents("b1"));
 }
开发者ID:unaveed,项目名称:Spreadsheet,代码行数:6,代码来源:MyUnitTests.cs

示例13: Test1400

 public void Test1400()
 {
     Spreadsheet s = new Spreadsheet();
     s.SetContentsOfCell("Z7", "=3");
     Formula f = (Formula)s.GetCellContents("Z7");
     Assert.AreEqual(new Formula("3"), f);
     Assert.AreNotEqual(new Formula("2"), f);
 }
开发者ID:unaveed,项目名称:Spreadsheet,代码行数:8,代码来源:MyUnitTests.cs

示例14: Test1000

 public void Test1000()
 {
     Spreadsheet s = new Spreadsheet();
     s.SetContentsOfCell("Z7", "hello");
     Assert.AreEqual("hello", s.GetCellContents("Z7"));
 }
开发者ID:unaveed,项目名称:Spreadsheet,代码行数:6,代码来源:MyUnitTests.cs

示例15: TestRead3

 public void TestRead3()
 {
     string path = "read3.xml";
     Spreadsheet sheet = new Spreadsheet();
     sheet.SetContentsOfCell("a1", "=1.5+4");
     sheet.SetContentsOfCell("b2", "=a2-2.6");
     sheet.SetContentsOfCell("c3", "=3.7*e5");
     sheet.SetContentsOfCell("d4", "hil");
     sheet.SetContentsOfCell("e5", "5.9");
     sheet.Save(path);
     HashSet<string> original = (HashSet<string>)sheet.GetNamesOfAllNonemptyCells();
     Spreadsheet sheet2 = new Spreadsheet(path, x => true, s => s, "default");
     foreach (string s in original) {
         Assert.IsTrue(sheet.GetCellContents(s).Equals(sheet2.GetCellContents(s)));
         Assert.IsTrue(sheet.GetCellValue(s).Equals(sheet2.GetCellValue(s)));
     }
 }
开发者ID:unaveed,项目名称:Spreadsheet,代码行数:17,代码来源:MyUnitTests.cs


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