Example #1
0
        public void SaveAndDuplicate01()
        {
            SpreadsheetTests01 s1 = new SpreadsheetTests01(new Regex("^[A-Z]*[1-2]$"));

            s1.SetContentsOfCell("A1", "2.0");
            s1.SetContentsOfCell("B1", "Garfield");
            s1.SetContentsOfCell("C1", "=A1 * 2");
            s1.SetContentsOfCell("D1", "");

            s1.Save(File.CreateText("../../ spreadsheetTest01.xml"));

            SpreadsheetTests01 s2 = new SpreadsheetTests01(File.OpenText(@"../../ spreadsheetTest01.xml"));

            Assert.AreEqual(2.0, s2.GetCellContents("A1"));
            Assert.AreEqual("Garfield", s2.GetCellContents("B1"));
            Assert.AreEqual(new Formula("A1 * 2").ToString(), s2.GetCellContents("C1").ToString());
            Assert.IsFalse(s2.Changed);
        }
Example #2
0
        public void Save01()
        {
            SpreadsheetTests01 s1 = new SpreadsheetTests01(new Regex("^[A-Z]*[1-2]$"));

            s1.Save(null);
        }