public void Seed() { _repo = new MenuItem_Repo(); MenuItem burger = new MenuItem(1, "Burgee", "Big ol burger", "burger stuff", 3.50); _repo.AddItemToMenuDirectory(burger); _item = new MenuItem(8, "BlamWhich", "KaBlam", "100% Blam", 15); _repo.AddItemToMenuDirectory(_item); }
public void AddToRepo_ShouldGetCorrectBool() //Create { //Arrange MenuItem item = new MenuItem(); MenuItem_Repo menu = new MenuItem_Repo(); //Act bool addResult = menu.AddMenuItem(item); //Assert Assert.IsTrue(addResult); }
public void GetMenu_ShouldReturnCorrectCollection()//Read { //Arrange MenuItem item = new MenuItem(); MenuItem_Repo menu = new MenuItem_Repo(); menu.AddMenuItem(item); //Act List <MenuItem> menuItems = menu.GetMenu(); bool menuHasItems = menuItems.Contains(item); //Assert Assert.IsTrue(menuHasItems); }
public void AddToMenu() { MenuItem item = new MenuItem(); item.MealNumber = 1; MenuItem_Repo repo = new MenuItem_Repo(); repo.AddItemToDirectory(item); MenuItem itemFromDirectory = repo.GetMealByNum(1); Assert.IsNotNull(itemFromDirectory); }
public void GetMenuByMealNum_ShouldReturnCorrectMenuItem()//Read { //Arrange MenuItem_Repo menu = new MenuItem_Repo(); MenuItem item = new MenuItem(01, "Burger and Fries", "Our delicious all beef burger and a medium fry", "Bun, Burger, Pickles, Onion, Lettuce, Tomato, Fries", 8); menu.AddMenuItem(item); int mealNum = 01; //Act MenuItem searchResult = menu.GetMenuItemByMealNum(mealNum); //Assert Assert.AreEqual(searchResult.MealNumber, mealNum); }
public void DeleteMenuItem_ShouldReturnTrue() //Delete { //Arrange MenuItem_Repo menu = new MenuItem_Repo(); MenuItem item = new MenuItem(01, "Burger and Fries", "Our delicious all beef burger and a medium fry", "Bun, Burger, Pickles, Onion, Lettuce, Tomato, Fries", 8); menu.AddMenuItem(item); int mealNum = 01; //Act MenuItem oldItem = menu.GetMenuItemByMealNum(mealNum); bool removeResult = menu.DeleteMenuItem(oldItem); //Assert Assert.IsTrue(removeResult); }
public void UpdateExistingMenuItem_ShouldReturnTrue() //Update { //Arrange MenuItem_Repo menu = new MenuItem_Repo(); MenuItem oldItem = new MenuItem(01, "Burger and Fries", "Our delicious all beef burger and a medium fry", "Bun, Burger, Pickles, Onion, Lettuce, Tomato, Fries", 8); menu.AddMenuItem(oldItem); MenuItem newItem = new MenuItem(02, "Bacon Cheese Burger and Fries", "Our delicious all beef burger and a medium fry", "Bun, Burger, Bacon, Cheese, Pickles, Onion, Lettuce, Tomato, Fries", 10); //Act bool updateResult = menu.UpdateExistingMenuItem(oldItem.MealNumber, newItem); //Assert Assert.IsTrue(updateResult); }