public void IteratorTest() { PancakeHouseMenu pancakeHouseMenu = new PancakeHouseMenu(); DinerMenu dinerMenu = new DinerMenu(); CafeMenu cafeMenu = new CafeMenu(); Waitress waitress = new Waitress(pancakeHouseMenu, dinerMenu, cafeMenu); waitress.PrintMenu(); waitress.PrintVegetarianMenu(); Console.WriteLine("\nCustomer asks, is the Hotdog vegetarian?"); Console.WriteLine("Waitress says: "); if (waitress.IsItemVegetarian("Hotdog")) { Console.WriteLine("Yes"); } else { Console.WriteLine("No"); } Console.WriteLine("\nCustomer asks, are the Waffles vegetarian?"); Console.WriteLine("Waitress says: "); if (waitress.IsItemVegetarian("Waffles")) { Console.WriteLine("Yes"); } else { Console.WriteLine("No"); } }
private void RemoveMenuItemFromList() { Console.WriteLine("Which item would you like to remove?"); int count = 0; List <CafeMenu> contentList = _listOfMenuItems.GetMenuItems(); foreach (CafeMenu content in contentList) { count++; Console.WriteLine($"{count}. {content.TypeOfOrder}"); } int contentNumber = int.Parse(Console.ReadLine()); int contentIndexNumber = contentNumber - 1; if (contentIndexNumber >= 0 && contentIndexNumber < contentList.Count) { CafeMenu desiredContent = contentList[contentIndexNumber]; if (_listOfMenuItems.RemoveMenuItemFromList(desiredContent)) { Console.WriteLine($"{desiredContent.TypeOfOrder} successfully removed"); } else { Console.WriteLine("404 Menu Item Not Found"); } } else { Console.WriteLine("No content has that ID."); } Console.WriteLine("Press any key to continue..."); Console.ReadKey(); }
public void DeleteItemFromMenu_ShouldDelete() { CafeMenu item = _repo.GetMenuItemByID(5); bool removeItem = _repo.DeleteItemFromMenu(item); Assert.IsTrue(removeItem); }
public void UpdatecafeMenuMeal_IsTrue(string oldMealName, bool updateSuccess) { CafeMenu newMenuItem = new CafeMenu("Club Sandwich", "Deli Club sandwhich on sourdough bread, served with house chips and a medium beverage.", 2, "ham, turkey, bacon, honeymustard, lettuce, sourdough bread, homemade potato chips", 8.99); bool updated = _cafeRepo.UpdateCafeMenuMeal(oldMealName, newMenuItem); Assert.IsTrue(updateSuccess); }
private void DeleteFromMenu() { ViewMenu(); Console.WriteLine("Which item number would you like to remove?"); int itemToDelete = int.Parse(Console.ReadLine()); Console.WriteLine($"Do you want to delete menu item number {itemToDelete}? Y/N"); string response = Console.ReadLine(); if (response.ToUpper() == "Y") { CafeMenu menuItem = _menuItems.GetMenuItemByID(itemToDelete); if (menuItem != null) { _menuItems.DeleteItemFromMenu(menuItem); Console.WriteLine($"{menuItem.MealName} was successfully removed."); } else { Console.WriteLine("I'm sorry! I can't find that menu item."); } } else { RunMenu(); } Console.WriteLine("Press any key to continue........"); Console.ReadKey(); }
public void TestWaitressPrintMenu() { StringBuilder printMenuOutput = new StringBuilder(); PancakeHouseMenu pancakeHouseMenu = new PancakeHouseMenu(); DinnerMenu dinnerMenu = new DinnerMenu(); CafeMenu cafeMenu = new CafeMenu(); Waitress waitress = new Waitress(pancakeHouseMenu, dinnerMenu, cafeMenu); printMenuOutput.Append("MENU\n"); printMenuOutput.Append("----\n"); printMenuOutput.Append("BREAKFAST\n"); printMenuOutput.Append("K&B's Pancake Breakfast, 2.99 -- Pancakes with scrambled eggs, and toast\n"); printMenuOutput.Append("Regular Pancake Breakfast, 2.99 -- Pancakes with fried eggs, and sausage\n"); printMenuOutput.Append("Blueberry Pancakes, 3.49 -- Pancakes made with fresh blueberries\n"); printMenuOutput.Append("Waffles, 3.59 -- Waffles, with your choice of blueberries or strawberries\n"); printMenuOutput.Append("\n"); printMenuOutput.Append("LUNCH\n"); printMenuOutput.Append("Vegetarian BLT, 2.99 -- (Fakin') Bacon with lettuce & tomato on whole wheat\n"); printMenuOutput.Append("BLT, 2.99 -- Bacon with lettuce & tomato on whole wheat\n"); printMenuOutput.Append("Soup of the day, 3.29 -- Soup of the day, with a side of potato salad\n"); printMenuOutput.Append("Hotdog, 3.05 -- A hot dog with saurkraut, relish, onions, topped with cheese\n"); printMenuOutput.Append("Steamed Veggies and Brown Rice, 3.99 -- Steamed vegetables over brown rice\n"); printMenuOutput.Append("Pasta, 3.89 -- Spaghetti with Marina Sauce and a slice of sourdough bread\n"); printMenuOutput.Append("\nDinner\n"); printMenuOutput.Append("Veggie Burger and Air Fries, 3.99 -- Veggie burger on a whole wheat bun, lettuce, tomato, and fries\n"); printMenuOutput.Append("Soup of the Day, 3.69 -- A cup of the soup of the day, with a side salad\n"); printMenuOutput.Append("Burrito, 4.29 -- A large burrito, with whole pinto beans, salsa, guacamole\n"); Assert.AreEqual(printMenuOutput.ToString(), waitress.PrintMenu()); }
private void UpdateCafeMenuMeal() { ShowFullCafeMenu(); Console.WriteLine("\n" + "Search the name of the meal you would like to update."); string oldMealName = Console.ReadLine(); CafeMenu newMenuItem = new CafeMenu(); Console.WriteLine("Enter the updated name for the meal: "); newMenuItem.MealName = Console.ReadLine(); Console.WriteLine("Enter the updated description of the meal: "); newMenuItem.Description = Console.ReadLine(); Console.WriteLine("Enter the updated combo number for the meal: "); string NewMealNumberString = Console.ReadLine(); newMenuItem.MealNumber = int.Parse(NewMealNumberString); Console.WriteLine("Enter the new ingredients included in the meal menu items: "); newMenuItem.Ingredient = Console.ReadLine(); Console.WriteLine("Enter the new price of the meal: "); string NewPriceString = Console.ReadLine(); newMenuItem.Price = double.Parse(NewPriceString); bool updateSuccessful = _cafeRepo.UpdateCafeMenuMeal(oldMealName, newMenuItem); if (updateSuccessful) { Console.WriteLine("Cafe menu item has been successfully updated."); } else { Console.WriteLine("Opps! The system could not successfully update the Cafe Menu."); } }
//Create a cafe menu item private void CreateNewMenuItem() { Console.Clear(); CafeMenu newMenuItem = new CafeMenu(); //Prompt user for the properties // Meal Number Console.WriteLine("Please enter the meal number of your new menu item followed by the enter key..."); newMenuItem.MealNumber = int.Parse(Console.ReadLine()); // Meal Name Console.WriteLine("Please enter the name of your new menu item followed by the enter key..."); newMenuItem.MealName = Console.ReadLine(); // Description Console.WriteLine("Please enter the description of your new menu item followed by the enter key..."); newMenuItem.Description = Console.ReadLine(); //Working out how to get user input and add to MealIngredients from List<SpecificEnum> didn't wuite get there in time // So, I changed it to a regular string Console.WriteLine("Please enter the ingredients in this meal: "); newMenuItem.MealIngredients = Console.ReadLine(); // Price Console.WriteLine("Please enter the price of your new menu item followed by the enter key..."); newMenuItem.Price = decimal.Parse(Console.ReadLine()); _cafeRepo.AddMenuItem(newMenuItem); }
public void AddMealToMenu_ShouldAdd() { CafeMenuRepo _cafeRepo = new CafeMenuRepo(); CafeMenu content = new CafeMenu(1, "Spaghetti", 14.99, "pasta and sauce", "tomato, garlic, pasta"); bool wasAdded = _cafeRepo.AddMealToMenu(content); Assert.IsTrue(wasAdded); }
public void AddMenuItem() { CafeMenu item = new CafeMenu(); MenuRepository repoDirectory = new MenuRepository(); bool addResult = repoDirectory.AddNewItem(item); Assert.IsTrue(addResult); }
public void AddToMenu() { CafeMenu menu = new CafeMenu(2, "Fish", "Fish", 3.00); CafeMenuRepository repository = new CafeMenuRepository(); bool addItem = repository.AddMenuItemToDirectory(menu); Assert.IsTrue(addItem); }
public void AddItemForTest() { List <string> ingred = new List <string> { "Green", "Red", "Yellow" }; _repo = new MenuRepository(); _content = new CafeMenu("Apple", 5, "Green", ingred, 3); _repo.AddNewItem(_content); }
private void SeedMenuList() { CafeMenu burger = new CafeMenu(1, "Cheese Burger", "Patty, Bun, Toppings", 2.50); CafeMenu smFries = new CafeMenu(2, "Small French Fries", "3.0 oz Fries", 1.50); CafeMenu smNuggets = new CafeMenu(3, "Small Chicken Nuggets", "6 Nuggets", 2.50); _menuDirectory.AddMenuItemToDirectory(burger); _menuDirectory.AddMenuItemToDirectory(smFries); _menuDirectory.AddMenuItemToDirectory(smNuggets); }
public void Arrange() { //Creating seed content _repo = new CafeMenuRepo(); _menuItemOne = new CafeMenu(5, "Pizza", 7.99, "cheese, sauce, & Heaven", "pizza dough, cheese, pepperoni"); _menuItemTwo = new CafeMenu(3, "Cereal", 2.99, "muesli and skim milk", "rolled oats, dried fruit, sugar, skim milk"); //Adding seed content to my list (here in unit test) _repo.AddMealToMenu(_menuItemOne); _repo.AddMealToMenu(_menuItemTwo); }
static void Main(string[] args) { PancakeHouseMenu pancakeHouseMenu = new PancakeHouseMenu(); DinerMenu dinerMenu = new DinerMenu(); CafeMenu cafeMenu = new CafeMenu(); Waitress waitress = new Waitress(pancakeHouseMenu, dinerMenu, cafeMenu); waitress.PrintMenu(); }
public void CafeMenuPOCOtests() { CafeMenu item = new CafeMenu(); Assert.AreEqual("Salmon Piccata", _item.Meal); Assert.AreEqual("Salmon filet grilled to perfection.", _item.MealDescription); Assert.AreEqual(45, _item.Price); Assert.AreEqual(2, _item.MenuItemID); Assert.AreEqual("Salmon", _item.Ingredients); }
static void TryPrintMenuFromWaitress() { Console.WriteLine("\n---- Waitress ----"); var breakfastMenu = new PancakeHouseMenu(); var dinerMenu = new DinerMenu(); var cafeMenu = new CafeMenu(); var waitress = new Waitress(dinerMenu, breakfastMenu, cafeMenu); waitress.PrintMenu(); }
public void Menu_MenuDescription_ShouldBeSetToString() { //-- Arrange CafeMenu cafeMenu = new CafeMenu("Chicken Tenders", 1, "Crispy delicious chicken tenders.", "Chicken, Breading, Fries, BBQ Sauce", 9.95m); //-- Act string actual = cafeMenu.Description; string expected = "Crispy delicious chicken tenders."; //-- Assert Assert.AreEqual(expected, actual); }
public void SeedItemList() { CafeMenu salmon = new CafeMenu("Salmon Piccata", "Salmon filet grilled to perfection.", 45, 2, "Salmon"); CafeMenu shrimp = new CafeMenu("Shrimp Scampi", "Shrimp sautéed in a garlic sauce", 25, 1, "Shrimp"); CafeMenu chicken = new CafeMenu("Grilled Chicken", "Grilled chicken breasts ", 40, 3, "Chicken breast"); CafeMenu zucchini = new CafeMenu("Zoodles Primavera", "Zucchini noodles tossed in a light basil cream sauce", 15, 4, "Zucchini"); _itemRepo.AddItemToList(salmon); _itemRepo.AddItemToList(shrimp); _itemRepo.AddItemToList(chicken); _itemRepo.AddItemToList(zucchini); }
public void GetMenuItems() { CafeMenu content = new CafeMenu(); MenuRepository repo = new MenuRepository(); repo.AddNewItem(content); List <CafeMenu> contents = repo.ViewMenu(); bool directoryHadContent = contents.Contains(content); Assert.IsTrue(directoryHadContent); }
public void AddToCafeMenu_MenuItemNotNull() { CafeMenu menuItem = new CafeMenu(); menuItem.MealName = "Roast Beef Sandwich"; CafeRepo repo = new CafeRepo(); repo.AddToCafeMenu(menuItem); CafeMenu menuItemByMealName = repo.SearchMealByName("Roast Beef Sandwich"); Assert.IsNotNull(menuItemByMealName); }
public void Menu_MenuNumber_ShouldBeSetToInt() { //-- Arrange CafeMenu cafeMenu = new CafeMenu("Chicken Tenders", 1, "Crispy delicious chicken tenders.", "Chicken, Breading, Fries, BBQ Sauce", 9.95m); //-- Act int actual = cafeMenu.Number; int expected = 1; //-- Assert Assert.AreEqual(expected, actual); }
public void Menu_MenuPrice_ShouldBeSetToDecimal() { //-- Arrange CafeMenu cafeMenu = new CafeMenu("Chicken Tenders", 1, "Crispy delicious chicken tenders.", "Chicken, Breading, Fries, BBQ Sauce", 9.95m); //-- Act decimal actual = cafeMenu.Price; decimal expected = 9.95m; //-- Assert Assert.AreEqual(expected, actual); }
public void ViewEntireMenu_ShouldShowAll() { CafeMenu content = new CafeMenu(); CafeMenuRepo repo = new CafeMenuRepo(); repo.AddMealToMenu(content); List <CafeMenu> allMenuItems = repo.ViewEntireMenu(); bool directoryHasContent = allMenuItems.Contains(content); Assert.IsTrue(directoryHasContent); }
public void DeleteFromMenu() { CafeMenu content = _repo.GetMenuItemByName("Land"); bool removeResult = _repo.DeleteMenuItemFromDirectory(content); Assert.IsTrue(removeResult); /* * CafeMenu menu = _repo.GetMenuItemByID(2); * _repo.DeleteMenuItemFromDirectory(menu); * Assert.AreEqual(firstCount - 1, List.Count); */ }
public void ShowAllMenu() { CafeMenu menu = new CafeMenu(); CafeMenuRepository repo = new CafeMenuRepository(); repo.AddMenuItemToDirectory(menu); List <CafeMenu> ListOfMenuItems = repo.GetMenu(); bool menuHasItem = ListOfMenuItems.Contains(menu); Assert.IsTrue(menuHasItem); }
public void AddToMenuTest() { //Arrange CafeMenu menuItem = new CafeMenu(); CafeMenuRepository cafeMenuRepository = new CafeMenuRepository(); //ACT bool addedToMenu = cafeMenuRepository.AddMenuItem(menuItem); //Assert Assert.IsTrue(addedToMenu); //Console.WriteLine(addedToMenu); }
public void GetItemByIngredientsTest() { //Arrange MenuRepository itemRepo = new MenuRepository(); CafeMenu item = new CafeMenu("Salmon Piccata", "Salmon filet grilled to perfection.", 45, 2, "Salmon"); //Act itemRepo.AddItemToList(item); CafeMenu actual = itemRepo.GetItemByIngredients("Salmon"); //Assert Assert.AreEqual(item, actual); }
public void RemoveFromListTest() { //Arrange MenuRepository itemRepo = new MenuRepository(); CafeMenu item = new CafeMenu("Salmon Piccata", "Salmon filet grilled to perfection.", 45, 2, "Salmon"); //Act itemRepo.AddItemToList(item); bool wasRemoved = itemRepo.RemoveItemFromList(item); //Assert Assert.IsTrue(wasRemoved); }
private void SeedMenuMeals() { CafeMenu BLT = new CafeMenu("BLT", "BLT sandwich on wheat bread, served with house chips and a medium beverage.", 1, "bacon, tomato, lettuce, mayo, wheat bread, homemade potato chips", 7.99); CafeMenu Club = new CafeMenu("Club Sandwich", "Deli Club sandwhich on sourdough bread, served with house chips and a medium beverage.", 2, "ham, turkey, bacon, honeymustard, lettuce, sourdough bread, homemade potato chips", 8.99); CafeMenu Turkey = new CafeMenu("Turkey Avocado", "Roasted Turkey Avocodo sandwich on wheat bread, served with house chips and a medium beverage.", 3, "turkey, avocado, mayo, lettuce, tomato, wheat bread, homemade potato chips", 8.99); CafeMenu VeggieClub = new CafeMenu("Veggie Club", "Veggie sandwich on french bread, served with house chips and a medium beverage", 4, "lettuce, tomato, spinach, green peppers, banana peppers, honeymustard, french white bread, homemade potato chips", 7.99); CafeMenu ChickenClub = new CafeMenu("Chicken Club", "Roasted Chicken and bacon on a toasted brioche bun, served with house chips and a medium beverage", 5, "roasted chicken breast, bacon, lettuce, tomato, ranch, brioche bun, homemade potato chips", 9.99); _cafeRepo.AddToCafeMenu(BLT); _cafeRepo.AddToCafeMenu(Club); _cafeRepo.AddToCafeMenu(Turkey); _cafeRepo.AddToCafeMenu(VeggieClub); _cafeRepo.AddToCafeMenu(ChickenClub); }
public CafeMenuEnumerator(CafeMenu cafeMenu) { items = cafeMenu.getItems(); keyEnumerator = items.Keys.GetEnumerator(); }
public CafeMenuIterator(CafeMenu cafeMenuItems) { _cafeMenuItems = cafeMenuItems.getItems(); keyItemsEnumerator = cafeMenuItems.getItems().Keys.GetEnumerator(); _next = MoveCursor(); }
static void Main(string[] args) { var dinnerMenu = new DinnerMenu(); var breakfastMenu = new BreakfastMenu(); var cafeMenu = new CafeMenu(); MenuComponent breakfastCMenu = new Menu("PANCAKE HOUSE", "Breakfast"); MenuComponent dinnerCMenu = new Menu("FINE DINING ITALIAN", "Dinner"); MenuComponent coffeeCMenu = new Menu("THE TEA HOSE", "Tea Time"); MenuComponent foodCourtMenu = new Menu("THE FOOD COURT - 24 Hours", "All day food"); foodCourtMenu.add(breakfastCMenu); foodCourtMenu.add(dinnerCMenu); foodCourtMenu.add(coffeeCMenu); MenuItem pasta = new MenuItem(5, "Lunch: Pasta", "Pasta", false); MenuItem soup = new MenuItem(10, "Lunch: Soup", "Soup", true); MenuItem salad = new MenuItem(15, "Lunch: Salda", "Salda", true); MenuItem tea = new MenuItem(6, "Tea Time: Tea", "Tea", true); MenuItem biscuit = new MenuItem(9, "Tea Time: Biscuit", "Biscuit", false); MenuItem cake = new MenuItem(12, "Tea Time: Cake", "Cake", false); MenuItem coffee = new MenuItem(11, "Breakfast: Coffee", "Coffee", true); MenuItem fruit = new MenuItem(22, "Breakfast: Fruit", "Fruit", true); MenuItem muesly = new MenuItem(33, "Breakfast: Muesly", "Muesly", false); breakfastCMenu.add(coffee); breakfastCMenu.add(fruit); breakfastCMenu.add(muesly); dinnerCMenu.add(pasta); dinnerCMenu.add(soup); dinnerCMenu.add(salad); coffeeCMenu.add(tea); coffeeCMenu.add(biscuit); coffeeCMenu.add(cake); WaitressComposite superWaittress = new WaitressComposite(foodCourtMenu); superWaittress.printMenu(); Console.ReadLine(); var javaWaitress = new JavaWaitressIterator(breakfastMenu, dinnerMenu, cafeMenu); var dinnerOrderId = javaWaitress.AddMenu(dinnerMenu); var breakfastOrderId = javaWaitress.AddMenu(breakfastMenu); var cafeOrderId = javaWaitress.AddMenu(cafeMenu); javaWaitress.PrintOrder(dinnerOrderId); javaWaitress.PrintOrder(breakfastOrderId); javaWaitress.PrintOrder(cafeOrderId); javaWaitress.PrintOrders(); javaWaitress.PrintOrdersWithIterators(); Console.ReadLine(); return; Console.WriteLine("Testing New Cafe Menu added"); javaWaitress.printCafeMenu_WithEnumerator(); javaWaitress.printCafeMenu_WithIterator(); Console.ReadLine(); return; Console.WriteLine("\nPrinting BREAKFAST MENU_____________________"); javaWaitress.printBreakfastMenu_WithEnumerator(); Console.WriteLine("\nPrinting LUNCH MENU_____________________"); javaWaitress.printDinnerMenu_WithEnumerator(); Console.WriteLine("\nPrinting ALL menu_____________________"); javaWaitress.printMenu(); Console.WriteLine("\nPrinting vegetarian dishes_____________________"); Console.WriteLine("Item {0} is vegetarian: {1}", "Set A", javaWaitress.isItemVegetarian("Set A")); Console.WriteLine("Item {0} is vegetarian: {1}", "Set B", javaWaitress.isItemVegetarian("Set B")); Console.WriteLine("Item {0} is vegetarian: {1}", "Set C", javaWaitress.isItemVegetarian("Set C")); Console.WriteLine("Item {0} is vegetarian: {1}", "Set D", javaWaitress.isItemVegetarian("Set D")); Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set A", javaWaitress.isItemVegetarian("Dinner Set A")); Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set B", javaWaitress.isItemVegetarian("Dinner Set B")); Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set C", javaWaitress.isItemVegetarian("Dinner Set C")); Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set D", javaWaitress.isItemVegetarian("Dinner Set D")); Console.ReadLine(); }