Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
            });
        }