本文整理汇总了C#中SS.AbstractSpreadsheet类的典型用法代码示例。如果您正苦于以下问题:C# AbstractSpreadsheet类的具体用法?C# AbstractSpreadsheet怎么用?C# AbstractSpreadsheet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractSpreadsheet类属于SS命名空间,在下文中一共展示了AbstractSpreadsheet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DivisionByZero1
public void DivisionByZero1(AbstractSpreadsheet ss)
{
Set(ss, "A1", "4.1");
Set(ss, "B1", "0.0");
Set(ss, "C1", "= A1 / B1");
Assert.IsInstanceOfType(ss.GetCellValue("C1"), typeof(FormulaError));
}
示例2: SetContentsWithFormulaReturnString
public string SetContentsWithFormulaReturnString(AbstractSpreadsheet sheet, string name, Formula formula)
{
List<string> cell_names = new List<string>(sheet.SetCellContents(name, formula));
string[] cell_array = cell_names.ToArray();
string text = string.Join(",", cell_array);
return text;
}
示例3: VV
//
//You can use the following additional attributes as you write your tests:
//
//Use ClassInitialize to run code before running the first test in the class
//[ClassInitialize()]
//public static void MyClassInitialize(TestContext testContext)
//{
//}
//
//Use ClassCleanup to run code after all tests in a class have run
//[ClassCleanup()]
//public static void MyClassCleanup()
//{
//}
//
//Use TestInitialize to run code before running each test
//[TestInitialize()]
//public void MyTestInitialize()
//{
//}
//
//Use TestCleanup to run code after each test has run
//[TestCleanup()]
//public void MyTestCleanup()
//{
//}
//
#endregion
// Verifies cells and their values, which must alternate.
public void VV(AbstractSpreadsheet sheet, params object[] constraints)
{
for (int i = 0; i < constraints.Length; i += 2)
{
if (constraints[i + 1] is double)
{
Assert.AreEqual((double)constraints[i + 1], (double)sheet.GetCellValue((string)constraints[i]), 1e-9);
}
else
{
Assert.AreEqual(constraints[i + 1], sheet.GetCellValue((string)constraints[i]));
}
}
}
示例4: OneFormula
public void OneFormula(AbstractSpreadsheet ss)
{
Set(ss, "A1", "4.1");
Set(ss, "B1", "5.2");
Set(ss, "C1", "= A1+B1");
VV(ss, "A1", 4.1, "B1", 5.2, "C1", 9.3);
}
示例5: NumberFormula2
public void NumberFormula2(AbstractSpreadsheet ss)
{
Set(ss, "A1", "= 4.6");
VV(ss, "A1", 4.6);
}
示例6: NumberFormula1
public void NumberFormula1(AbstractSpreadsheet ss)
{
Set(ss, "A1", "4.1");
Set(ss, "C1", "= A1 + 4.2");
VV(ss, "C1", 8.3);
}
示例7: MediumSheet
public void MediumSheet(AbstractSpreadsheet ss)
{
Set(ss, "A1", "1.0");
Set(ss, "A2", "2.0");
Set(ss, "A3", "3.0");
Set(ss, "A4", "4.0");
Set(ss, "B1", "= A1 + A2");
Set(ss, "B2", "= A3 * A4");
Set(ss, "C1", "= B1 + B2");
VV(ss, "A1", 1.0, "A2", 2.0, "A3", 3.0, "A4", 4.0, "B1", 3.0, "B2", 12.0, "C1", 15.0);
Set(ss, "A1", "2.0");
VV(ss, "A1", 2.0, "A2", 2.0, "A3", 3.0, "A4", 4.0, "B1", 4.0, "B2", 12.0, "C1", 16.0);
Set(ss, "B1", "= A1 / A2");
VV(ss, "A1", 2.0, "A2", 2.0, "A3", 3.0, "A4", 4.0, "B1", 1.0, "B2", 12.0, "C1", 13.0);
}
示例8: Formulas
public void Formulas(AbstractSpreadsheet ss)
{
Set(ss, "A1", "4.4");
Set(ss, "B1", "2.2");
Set(ss, "C1", "= A1 + B1");
Set(ss, "D1", "= A1 - B1");
Set(ss, "E1", "= A1 * B1");
Set(ss, "F1", "= A1 / B1");
VV(ss, "C1", 6.6, "D1", 2.2, "E1", 4.4 * 2.2, "F1", 2.0);
}
示例9: Set
// For setting a spreadsheet cell.
public IEnumerable<string> Set(AbstractSpreadsheet sheet, string name, string contents)
{
List<string> result = new List<string>(sheet.SetContentsOfCell(name, contents));
return result;
}
示例10: Formula1
public void Formula1(AbstractSpreadsheet ss)
{
Set(ss, "a1", "= a2 + a3");
Set(ss, "a2", "= b1 + b2");
Assert.IsInstanceOfType(ss.GetCellValue("a1"), typeof(FormulaError));
Assert.IsInstanceOfType(ss.GetCellValue("a2"), typeof(FormulaError));
Set(ss, "a3", "5.0");
Set(ss, "b1", "2.0");
Set(ss, "b2", "3.0");
VV(ss, "a1", 10.0, "a2", 5.0);
Set(ss, "b2", "4.0");
VV(ss, "a1", 11.0, "a2", 6.0);
}
示例11: OneNumber
public void OneNumber(AbstractSpreadsheet ss)
{
Set(ss, "C1", "17.5");
VV(ss, "C1", 17.5);
}
示例12: Formula2
public void Formula2(AbstractSpreadsheet ss)
{
Set(ss, "a1", "= a2 + a3");
Set(ss, "a2", "= a3");
Set(ss, "a3", "6.0");
VV(ss, "a1", 12.0, "a2", 6.0, "a3", 6.0);
Set(ss, "a3", "5.0");
VV(ss, "a1", 10.0, "a2", 5.0, "a3", 5.0);
}
示例13: OneString
public void OneString(AbstractSpreadsheet ss)
{
Set(ss, "B1", "hello");
VV(ss, "B1", "hello");
}
示例14: Formula3
public void Formula3(AbstractSpreadsheet ss)
{
Set(ss, "a1", "= a3 + a5");
Set(ss, "a2", "= a5 + a4");
Set(ss, "a3", "= a5");
Set(ss, "a4", "= a5");
Set(ss, "a5", "9.0");
VV(ss, "a1", 18.0);
VV(ss, "a2", 18.0);
Set(ss, "a5", "8.0");
VV(ss, "a1", 16.0);
VV(ss, "a2", 16.0);
}
示例15: StringArgument
public void StringArgument(AbstractSpreadsheet ss)
{
Set(ss, "A1", "4.1");
Set(ss, "B1", "hello");
Set(ss, "C1", "= A1 + B1");
Assert.IsInstanceOfType(ss.GetCellValue("C1"), typeof(FormulaError));
}