public Foods FindFoodOnMenu(string name) { var menuFood = new Foods(); foreach (var item in _foodList) { if (name == item.Name) { menuFood = item; break; } } return(menuFood); }
public void ShouldFindSearchedFoodOnMenu() { MenuRepo _menuRepo = new MenuRepo(); Foods item1 = new Foods(); item1.Name = "Burger"; _menuRepo.AddFoodToMenu(item1); Foods actual = _menuRepo.FindFoodOnMenu("Burger"); Foods expected = item1; Assert.AreEqual(expected, actual); }
public void ShouldAddFoodToMenu() { MenuRepo _menuRepo = new MenuRepo(); Foods item = new Foods(); _menuRepo.AddFoodToMenu(item); var list = _menuRepo.GetList(); int actual = list.Count; int expected = 1; Assert.AreEqual(expected, actual); }
private void SeedMenu() { List <string> ingsList = new List <string>(); ingsList.Add("patty"); ingsList.Add("buns"); Foods item1 = new Foods(1, "Hamburger", "Two buns and a beef patty", ingsList, 8); Foods item2 = new Foods(2, "Cheeseburger", "Two buns, beef patty, and cheese", ingsList, 9); Foods item3 = new Foods(3, "Turkey Burger", "Two buns, turkey patty", ingsList, 10); _menuRepo.AddFoodToMenu(item1); _menuRepo.AddFoodToMenu(item2); _menuRepo.AddFoodToMenu(item3); }
public void ShouldRemoveFoodFromMenu() { MenuRepo _menuRepo = new MenuRepo(); Foods item1 = new Foods(); Foods item2 = new Foods(); _menuRepo.AddFoodToMenu(item1); _menuRepo.AddFoodToMenu(item2); _menuRepo.DeleteFoodFromMenu(item1); var list = _menuRepo.GetList(); int actual = list.Count; int expected = 1; Assert.AreEqual(expected, actual); }
private void AddFoodToMenu() { Console.Clear(); Console.WriteLine("Name the food you would like to add?"); string mealName = Console.ReadLine(); Console.WriteLine("What number do you want this to have?"); string mealNum = Console.ReadLine(); Console.WriteLine("Enter a description of this food."); string desc = Console.ReadLine(); Console.WriteLine("Enter the price of the food."); string price = Console.ReadLine(); Foods itemAdded = new Foods(); _menuRepo.AddFoodToMenu(itemAdded); Console.WriteLine("Food has been added to the menu."); RunStartMenu(); }
public void DeleteFoodFromMenu(Foods menuFood) { _foodList.Remove(menuFood); }
public void AddFoodToMenu(Foods menuFood) { _foodList.Add(menuFood); }