本文整理汇总了C#中Sheet.get方法的典型用法代码示例。如果您正苦于以下问题:C# Sheet.get方法的具体用法?C# Sheet.get怎么用?C# Sheet.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sheet
的用法示例。
在下文中一共展示了Sheet.get方法的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: 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));
}
示例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: 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"));
}
示例5: 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"));
}
示例6: 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"));
}
示例7: 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"));
}
示例8: testDeepParentheses
public void testDeepParentheses()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=((((10))))");
Assert.AreEqual("10", sheet.get("A1"));
}
示例9: 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"));
}
示例10: testParenthesisError
public void testParenthesisError()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=(((((7))");
Assert.AreEqual("#Error", sheet.get("A1"));
}
示例11: testSimpleFormulaError
public void testSimpleFormulaError()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=7*");
Assert.AreEqual("#Error", sheet.get("A1"));
}
示例12: testFullExpression
public void testFullExpression()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=7*(2+3)*((((2+1))))");
Assert.AreEqual("105", sheet.get("A1"));
}
示例13: testPrecedence
public void testPrecedence()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=7+2*3");
Assert.AreEqual("13", sheet.get("A1"));
}
示例14: testAdd
public void testAdd()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=71+2+3");
Assert.AreEqual("76", sheet.get("A1"));
}
示例15: testMultiply
public void testMultiply()
{
Sheet sheet = new Sheet();
sheet.put("A1", "=2*3*4");
Assert.AreEqual("24", sheet.get("A1"));
}