public void NewTest11()
 {
     Spreadsheet s = new Spreadsheet(x => true, x => x, "\"default\"");
     s.SetContentsOfCell("a1", "Text");
     s.Save("..\\..\\..\\Test.xml");
     string sversion = s.GetSavedVersion("..\\..\\..\\Test.xml");
     Assert.AreEqual("\"default\"", sversion);
 }
Beispiel #2
0
 public void TestSavedVersion3()
 {
     Spreadsheet sheet = new Spreadsheet();
     sheet.GetSavedVersion("thisisnotafile.txt");
 }
Beispiel #3
0
 public void TestSavedVersion2()
 {
     string version = "10.2091.23";
     Spreadsheet sheet = new Spreadsheet(x => true, s => s, version);
     sheet.SetContentsOfCell("a1", "hello");
     string path = "savedVersion2.xml";
     sheet.Save(path);
     Assert.AreEqual(version, sheet.GetSavedVersion(path));
 }
Beispiel #4
0
 public void TestSavedVersion1()
 {
     Spreadsheet sheet = new Spreadsheet();
     sheet.SetContentsOfCell("a1", "hello");
     string path = "savedVersion1.xml";
     sheet.Save(path);
     string version = "default";
     Assert.AreEqual(version, sheet.GetSavedVersion(path));
 }
Beispiel #5
0
        public void GetSavedVersionTest()
        {
            string existing_path = @"..\..\..\SpreadSheetTests\validspreadsheet.xml"; // the .. means up a directory

            Spreadsheet target = new Spreadsheet(existing_path, s => true, s => s.ToUpper(), "dan1");
            Assert.AreEqual("dan1", target.GetSavedVersion(existing_path));
        }
 public void GetSavedVersionTest()
 {
     Spreadsheet target = new Spreadsheet(); // TODO: Initialize to an appropriate value
     string filename = string.Empty; // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     actual = target.GetSavedVersion(filename);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void GetSavedVersionTest()
 {
     Spreadsheet s = new Spreadsheet(TestValidToFalse, TestNormalizeToUpperCase, "test123");
     s.Save("test.xml");
     Assert.AreEqual("test123", s.GetSavedVersion("test.xml"));
     File.Delete("test.xml");
 }
Beispiel #8
0
        public void GetSavedVersionTest()
        {
            // Returns the version information of the spreadsheet saved in the named file.
            string filename = "GetSavedVersionTest.xml";
            string version = "onesandcaps";

            AbstractSpreadsheet s2 = new Spreadsheet(x => (Regex.IsMatch(x, @"^[a-zA-Z]+[1]$")) ? (true) : (false), y => y.ToUpper(), version);
            s2.Save(filename);
            AbstractSpreadsheet s = new Spreadsheet();

            string actual = s.GetSavedVersion(filename);
            string expected = version;
            Assert.AreEqual(expected, actual);
        }