public void CheckSave() { Catalog.Add(new Book(DataToTest.InfoToCatalog().ElementAt(3))); string toSave = Catalog.Save(); string toCompare = DataToTest.ToCompareForSave; Assert.IsTrue(toSave.Equals(toCompare)); }
internal static void GetDataToTest() { Catalog.DeleteAll(); var allInfoToCatalog = DataToTest.InfoToCatalog(); Catalog.Add(new Book(allInfoToCatalog[0])); Catalog.Add(new Book(allInfoToCatalog[3])); Catalog.Add(new Newspaper(allInfoToCatalog[1])); Catalog.Add(new Newspaper(allInfoToCatalog[4])); Catalog.Add(new Patent(allInfoToCatalog[2])); Catalog.Add(new Patent(allInfoToCatalog[5])); }
public void CheckEdit() { DataToTest.GetDataToTest(); var newData = DataToTest.InfoToCatalog().ElementAt(6); var toEdit = Catalog.AllItem.ElementAt(0); var oldTitle = toEdit.Title; Catalog.Edit(toEdit, newData); Assert.IsTrue(!toEdit.Title.Equals(oldTitle)); }
internal static List <ItemCatalog> GetDataToSearchOrSort() { var catalog = new List <ItemCatalog> { new Book(DataToTest.InfoToCatalog()[0]), new Book(DataToTest.InfoToCatalog()[3]), new Newspaper(DataToTest.InfoToCatalog()[1]), new Newspaper(DataToTest.InfoToCatalog()[4]), new Patent(DataToTest.InfoToCatalog()[2]), new Patent(DataToTest.InfoToCatalog()[5]) }; return(catalog); }