public void TestToStringSaveToFile() { var l = new LegendViewModel(30, 0); var Expectlist = l.ListOfLagendItems.ToList(); var str = l.ToString(); var path = @"F:\scale.scl"; LoadSaveFromToTextFile.SaveFile(str, path); Assert.IsTrue(File.Exists(path)); TempFileManager.DeleteTmpFile(path); }
public void TestReadAndPopulateFromFile() { var l = new LegendViewModel(30, 0); var Expectlist = l.ListOfLagendItems.ToList(); var str = l.ToString(); var path = @"F:\scale.scl"; LoadSaveFromToTextFile.SaveFile(str, path); var Getslist = l.PopulateTableFromString(LoadSaveFromToTextFile.ReadFile(path)); TempFileManager.DeleteTmpFile(path); Getslist.ForEach(x => { Assert.AreEqual(Expectlist[Getslist.IndexOf(x)], x); }); }