public void AddingPizzaToMenuAndThenSearchingForIt() { // Arrange MenuCatalog _menutest = new MenuCatalog(); IMenuItem Pizza = new MenuItem(1, "Pizza", "A pizza", 30, MenuType.Pizza, false, true); IMenuItem expectedresult = Pizza; // Act _menutest.Add(Pizza); _menutest.Search(1); // Assert Assert.AreSame(expectedresult, _menutest.Search(1)); }
public void SearchMenuItemThatDoesNotExistTest() { //Arrange IMenuCatalog catalog = new MenuCatalog(); //Act catalog.Search(2); //Assert }
public void UpdateItem() { IMenuCatalog mc = new MenuCatalog(); IMenuItem p1 = new Pizza(1, "LIVER KILLER", "�Ldont eat this", 27, MenuType.Pizza, true, true, true); mc.Add(p1); IMenuItem p2 = new Pizza(2, "LIVER KILLER", "�Ldont eat this", 27, MenuType.Pizza, true, true, true); mc.Update(1, p2); Assert.AreSame(p2, mc.Search(1)); }
public void SearchItem() { IMenuCatalog mc = new MenuCatalog(); IMenuItem p1 = new Pizza(1, "LIVER KILLER", "�Ldont eat this", 27, MenuType.Pizza, true, true, true); mc.Add(p1); IMenuItem p2 = new Pizza(2, "LIVER KILLER", "�Ldont eat this", 27, MenuType.Pizza, true, true, true); mc.Add(p2); IMenuItem placeHolder = mc.Search(2); Assert.AreSame(p2, placeHolder); }
public void SearchItemTest() { //Arrange IMenuCatalog catalog = new MenuCatalog(); IMenuItem t1 = new Topping(1, "Topping", "sdxfcgvhbj", 1, MenuType.Topping, true, true); IMenuItem t2 = new Topping(2, "more Topping", "a", 3, MenuType.Topping, false, false); //Act catalog.Add(t1); catalog.Add(t2); IMenuItem result = catalog.Search(1); //Assert Assert.AreEqual(t1, result); }
public void UpdateMenuItemTest() { //Arrange IMenuCatalog catalog = new MenuCatalog(); IMenuItem t1 = new Topping(1, "Topping", "sdxfcgvhbj", 1, MenuType.Topping, true, true); IMenuItem t1New = new Topping(1, "more Topping", "a", 3, MenuType.Topping, false, false); catalog.Add(t1); //Act catalog.Update(1, t1New); //Assert Assert.AreEqual(t1New, catalog.Search(1)); }