本文整理汇总了C#中SS.Spreadsheet.IsValid方法的典型用法代码示例。如果您正苦于以下问题:C# Spreadsheet.IsValid方法的具体用法?C# Spreadsheet.IsValid怎么用?C# Spreadsheet.IsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SS.Spreadsheet
的用法示例。
在下文中一共展示了Spreadsheet.IsValid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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"));
}
示例2: SpreadsheetFourArgumentConstructorTest
public void SpreadsheetFourArgumentConstructorTest()
{
if (!File.Exists("fourarg.xml"))
{
Spreadsheet old = new Spreadsheet(TestValidToTrue, TestNormalizeToUpperCase, "2.2");
old.SetContentsOfCell("A1", "asdf");
old.SetContentsOfCell("B2", "23");
old.Save("fourarg.xml");
}
Spreadsheet s = new Spreadsheet("fourarg.xml", TestValidToTrue, TestNormalizeToUpperCase, "2.2");
Assert.AreEqual(true, s.IsValid("a"));
Assert.AreEqual("A", s.Normalize("a"));
Assert.AreEqual("asdf", s.GetCellContents("A1"));
Assert.AreEqual(23.0, s.GetCellContents("B2"));
Assert.AreEqual(23.0, s.GetCellValue("B2"));
Assert.AreEqual("2.2", s.Version);
}
示例3: SpreadsheetThreeArgumentConstructorTest
public void SpreadsheetThreeArgumentConstructorTest()
{
Spreadsheet s = new Spreadsheet(TestValidToFalse, TestNormalizeToUpperCase, "1.1");
Assert.AreEqual(false, s.IsValid("a"));
Assert.AreEqual("A1", s.Normalize("a1"));
Assert.AreEqual("1.1", s.Version);
}
示例4: SpreadsheetTest
public void SpreadsheetTest()
{
Spreadsheet s = new Spreadsheet();
Assert.AreEqual("a", s.Normalize("a"));
Assert.AreEqual(true, s.IsValid("a"));
Assert.AreEqual("default", s.Version);
}