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


C# Sheet.put方法代码示例

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


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

示例1: testThatTextCellsAreStored

        public void testThatTextCellsAreStored()
        {
            var sheet = new Sheet();
            var theCell = "A21";

            sheet.put(theCell, "A string");
            Assert.AreEqual("A string", sheet.get(theCell));

            sheet.put(theCell, "A different string");
            Assert.AreEqual("A different string", sheet.get(theCell));

            sheet.put(theCell, "");
            Assert.AreEqual("", sheet.get(theCell));
        }
开发者ID:david--liu,项目名称:code_kata,代码行数:14,代码来源:SpreadSheetTest.cs

示例2: testThatWeHaveAccessToCellLiteralValuesForEditing

        public void testThatWeHaveAccessToCellLiteralValuesForEditing()
        {
            var sheet = new Sheet();
            var theCell = "A21";

            sheet.put(theCell, "Some string");
            Assert.AreEqual("Some string", sheet.getLiteral(theCell));

            sheet.put(theCell, " 1234 ");
            Assert.AreEqual(" 1234 ", sheet.getLiteral(theCell));

            sheet.put(theCell, "=7"); // Foreshadowing formulas:)
            Assert.AreEqual("=7", sheet.getLiteral(theCell));
        }
开发者ID:david--liu,项目名称:code_kata,代码行数:14,代码来源:SpreadSheetTest.cs

示例3: testThatManyCellsExist

        public void testThatManyCellsExist()
        {
            Sheet sheet = new Sheet();
            sheet.put("A1", "First");
            sheet.put("X27", "Second");
            sheet.put("ZX901", "Third");

            Assert.AreEqual("First", sheet.get("A1"));
            Assert.AreEqual("Second", sheet.get("X27"));
            Assert.AreEqual("Third", sheet.get("ZX901"));

            sheet.put("A1", "Fourth");
            Assert.AreEqual("Fourth", sheet.get("A1"));
            Assert.AreEqual("Second", sheet.get("X27"));
            Assert.AreEqual("Third", sheet.get("ZX901"));
        }
开发者ID:david--liu,项目名称:code_kata,代码行数:16,代码来源:SpreadSheetTest.cs

示例4: testThatNumericCellsAreIdentifiedAndStored

        public void testThatNumericCellsAreIdentifiedAndStored()
        {
            var sheet = new Sheet();
            var theCell = "A21";

            sheet.put(theCell, "X99"); // "Obvious" string
            Assert.AreEqual("X99", sheet.get(theCell));

            sheet.put(theCell, "14"); // "Obvious" number
            Assert.AreEqual("14", sheet.get(theCell));

            sheet.put(theCell, " 99 X"); // Whole string must be numeric
            Assert.AreEqual(" 99 X", sheet.get(theCell));

            sheet.put(theCell, " 1234 "); // Blanks ignored
            Assert.AreEqual("1234", sheet.get(theCell));

            sheet.put(theCell, " "); // Just a blank
            Assert.AreEqual(" ", sheet.get(theCell));
        }
开发者ID:david--liu,项目名称:code_kata,代码行数:20,代码来源:SpreadSheetTest.cs

示例5: testThatMultiCircularReferencesAdmitIt

 public void testThatMultiCircularReferencesAdmitIt()
 {
     Sheet sheet = new Sheet();
     sheet.put("A1", "=A3");
     sheet.put("A2", "=A1");
     sheet.put("A3", "=A2");
     Assert.AreEqual("#Circular", sheet.get("A1"));
     Assert.AreEqual("#Circular", sheet.get("A2"));
     Assert.AreEqual("#Circular", sheet.get("A3"));
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:10,代码来源:SpreadSheetTest.cs

示例6: testThatFormulaWorksWithManyCells

        public void testThatFormulaWorksWithManyCells()
        {
            Sheet sheet = new Sheet();
            sheet.put("A1", "10");
            sheet.put("A2", "=A1+B1");
            sheet.put("A3", "=A2+B2");
            sheet.put("A4", "=A3");
            sheet.put("B1", "7");
            sheet.put("B2", "=A2");
            sheet.put("B3", "=A3-A2");
            sheet.put("B4", "=A4+B3");

            Assert.AreEqual("34", sheet.get("A4"));
            Assert.AreEqual("51", sheet.get("B4"));
        }
开发者ID:david--liu,项目名称:code_kata,代码行数:15,代码来源:SpreadSheetTest.cs

示例7: testThatDeepPropagationWorks

        public void testThatDeepPropagationWorks()
        {
            Sheet sheet = new Sheet();
            sheet.put("A1", "8");
            sheet.put("A2", "=A1");
            sheet.put("A3", "=A2");
            sheet.put("A4", "=A3");
            Assert.AreEqual("8", sheet.get("A4"));

            sheet.put("A2", "6");
            Assert.AreEqual("6", sheet.get("A4"));
        }
开发者ID:david--liu,项目名称:code_kata,代码行数:12,代码来源:SpreadSheetTest.cs

示例8: testThatFormulasKnowCellsAndRecalculate

        public void testThatFormulasKnowCellsAndRecalculate()
        {
            Sheet sheet = new Sheet();
            sheet.put("A1", "8");
            sheet.put("A2", "3");
            sheet.put("B1", "=A1*(A1-A2)+A2/3");
            Assert.AreEqual("41", sheet.get("B1"));

            sheet.put("A2", "6");
            Assert.AreEqual("18", sheet.get("B1"));
        }
开发者ID:david--liu,项目名称:code_kata,代码行数:11,代码来源:SpreadSheetTest.cs

示例9: testDeepParentheses

 public void testDeepParentheses()
 {
     Sheet sheet = new Sheet();
     sheet.put("A1", "=((((10))))");
     Assert.AreEqual("10", sheet.get("A1"));
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:SpreadSheetTest.cs

示例10: testFormulaSpec

 public void testFormulaSpec()
 {
     Sheet sheet = new Sheet();
     sheet.put("B1", " =7"); // note leading space
     Assert.AreEqual(" =7", sheet.get("B1"));
     Assert.AreEqual(" =7", sheet.getLiteral("B1"));
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:7,代码来源:SpreadSheetTest.cs

示例11: testParenthesisError

 public void testParenthesisError()
 {
     Sheet sheet = new Sheet();
     sheet.put("A1", "=(((((7))");
     Assert.AreEqual("#Error", sheet.get("A1"));
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:SpreadSheetTest.cs

示例12: testSimpleFormulaError

 public void testSimpleFormulaError()
 {
     Sheet sheet = new Sheet();
     sheet.put("A1", "=7*");
     Assert.AreEqual("#Error", sheet.get("A1"));
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:SpreadSheetTest.cs

示例13: testFullExpression

 public void testFullExpression()
 {
     Sheet sheet = new Sheet();
     sheet.put("A1", "=7*(2+3)*((((2+1))))");
     Assert.AreEqual("105", sheet.get("A1"));
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:SpreadSheetTest.cs

示例14: testPrecedence

 public void testPrecedence()
 {
     Sheet sheet = new Sheet();
     sheet.put("A1", "=7+2*3");
     Assert.AreEqual("13", sheet.get("A1"));
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:SpreadSheetTest.cs

示例15: testAdd

 public void testAdd()
 {
     Sheet sheet = new Sheet();
     sheet.put("A1", "=71+2+3");
     Assert.AreEqual("76", sheet.get("A1"));
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:SpreadSheetTest.cs


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