本文整理汇总了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));
}
示例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));
}
示例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"));
}
示例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));
}
示例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"));
}
示例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"));
}
示例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"));
}
示例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"));
}
示例9: testDeepParentheses
public void testDeepParentheses()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=((((10))))");
Assert.AreEqual("10", sheet.get("A1"));
}
示例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"));
}
示例11: testParenthesisError
public void testParenthesisError()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=(((((7))");
Assert.AreEqual("#Error", sheet.get("A1"));
}
示例12: testSimpleFormulaError
public void testSimpleFormulaError()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=7*");
Assert.AreEqual("#Error", sheet.get("A1"));
}
示例13: testFullExpression
public void testFullExpression()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=7*(2+3)*((((2+1))))");
Assert.AreEqual("105", sheet.get("A1"));
}
示例14: testPrecedence
public void testPrecedence()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=7+2*3");
Assert.AreEqual("13", sheet.get("A1"));
}
示例15: testAdd
public void testAdd()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=71+2+3");
Assert.AreEqual("76", sheet.get("A1"));
}