public void MenuRepository_FindFoodByName_ShouldReturnString() { //--Arrange List <Menu> findNameTest = menuRepo.GetMenu(); Menu findName = new Menu(8, "Bratwurst", "Better than a hot dog", 4.99m, "Brat, bun, toppings"); menuRepo.AddItemToMenu(findName); Menu foundIt = menuRepo.FindFoodByName("Bratwurst"); //--Act string actual = foundIt.MealName; string expected = "Bratwurst"; //--Assert Assert.AreEqual(expected, actual); }
private void RunStartMenu() { ShowStartMenu(); bool continueToRunMenu = true; while (continueToRunMenu) { int choice = GetParseMenuChoice(); switch (choice) { case 1: PrintAllFoodByName(); break; case 2: PrintAllFoodWithDetail(); break; case 3: while (true) { Console.WriteLine("What is the new meal number?"); int num = Int32.Parse(Console.ReadLine()); Console.WriteLine("What is this meal called?"); var name = Console.ReadLine(); Console.WriteLine("What is the description?"); var desc = Console.ReadLine(); Console.WriteLine("What is the price?"); decimal pr = decimal.Parse(Console.ReadLine()); Console.WriteLine("Whats in it?"); string ingr = Console.ReadLine(); Menu userFood = new Menu(num, name, desc, pr, ingr); _menuRepo.AddItemToMenu(userFood); Console.WriteLine("Do you want to add something else? y/n"); string answer = Console.ReadLine(); if (answer == "y") { } else if (answer == "n") { break; } } break; case 4: while (true) { Console.WriteLine("Which item do you want to remove?"); string meal = Console.ReadLine(); var oldName = _menuRepo.FindFoodByName(meal); Console.WriteLine("Do you want to delete this item?"); string theAnswer = Console.ReadLine(); if (theAnswer == "y") { _menuRepo.RemoveMenuItem(oldName); break; } else if (theAnswer == "n") { break; } } break; case 5: continueToRunMenu = false; break; default: ShowStartMenu(); break; } } }