private void DisplayMenu(KomodoCafeMenu content) { Console.WriteLine( $"Number: {content.MealNum} \n" + $"Name: {content.MealName}\n" + $"Description: {content.MealDesc}\n" + $"Ingredients: {content.Ingredients}\n" + $"Price: {content.Price}\n"); }
public void setDesc_CorrectDesc() { KomodoCafeMenu content = new KomodoCafeMenu(); content.MealDesc = "Best Burger Ever"; string expected = "Best Burger Ever"; string actual = content.MealDesc; Assert.AreEqual(expected, actual); }
public void setIngred_CorrectIngred() { KomodoCafeMenu content = new KomodoCafeMenu(); content.Ingredients = "Cow, Flour"; string expected = "Cow, Flour"; string actual = content.Ingredients; Assert.AreEqual(expected, actual); }
public void SetName_CorrectName() { KomodoCafeMenu content = new KomodoCafeMenu(); content.MealName = "Burger1"; string expected = "Burger1"; string actual = content.MealName; Assert.AreEqual(expected, actual); }
public void SetNumber_CorrectNum() { KomodoCafeMenu content = new KomodoCafeMenu(); content.MealNum = 1; int expected = 1; int actual = content.MealNum; Assert.AreEqual(expected, actual); }
public void SetPrice_CorrectPrice() { KomodoCafeMenu content = new KomodoCafeMenu(); content.Price = 66.66m; decimal expected = 66.66m; decimal actual = content.Price; Assert.AreEqual(expected, actual); }
public void AddMenuItemToList_ShouldNotBeNull() { KomodoCafeMenuRepository repo = new KomodoCafeMenuRepository(); KomodoCafeMenu menuItem = new KomodoCafeMenu(2, "salad", "a big salad", "salad ingredients", 8.35m); repo.AddMenuItemToList(menuItem); KomodoCafeMenu menuItemFromList = repo.GetMenuItemByMealNumber(2); Assert.IsNotNull(menuItemFromList); }
private void SeedMenuList() { KomodoCafeMenu A = new KomodoCafeMenu(1, "Burger", "2 patty burger and fries", "Patty, bun, tomato, lettuce, onion, ketchup, mustard, pickle, special sauce, potatoes", 7.25m); KomodoCafeMenu B = new KomodoCafeMenu(2, "Nachos", "Chips, veggies and special sauce--a customer favorite!", "Tortilla chips, black olives, onions, tomatoes, bell peppers, special sauce", 8.50m); KomodoCafeMenu C = new KomodoCafeMenu(3, "Chili", "Hearty bean chili bowl to keep you warm in the winter!", "Beans, tomatoes, onions, jalapenos, rice, special sauce", 6.25m); _menuList.AddMenuItemToList(A); _menuList.AddMenuItemToList(B); _menuList.AddMenuItemToList(C); }
public void Seed() { _repo = new KomodoCafeRepo(); burger = new KomodoCafeMenu( 1, "BurgerMeal", "Big Burger Meal", "Flour, cow", 55.55m ); KomodoCafeMenu Chicken = new KomodoCafeMenu( 2, "Chicken Meal", "Spicky chicken sammich", "flour, chicken, spice", 66.66m); _repo.AddContentToDirectory(burger); _repo.AddContentToDirectory(Chicken); }
//case 3 private void CreateMenuItem() { Console.Clear(); KomodoCafeMenu content = new KomodoCafeMenu(); //Meal Number Console.WriteLine("Please enter the new item's number"); content.MealNum = Convert.ToInt32(Console.ReadLine()); //Meal Name Console.WriteLine("Please enter the item's name"); content.MealName = Console.ReadLine(); //Meal Description Console.WriteLine("Please describe the new item"); content.MealDesc = Console.ReadLine(); //Ingredients Console.WriteLine("Please list the ingredients for the new item"); content.Ingredients = Console.ReadLine(); //Price Console.WriteLine("Please list the price for the new item"); content.Price = Convert.ToDecimal(Console.ReadLine()); _repo.AddContentToDirectory(content); }
//case 2 private void RemoveFromMenu() { Console.Clear(); Console.WriteLine("What is the number of the item you'd like to remove?"); List <KomodoCafeMenu> listOfItems = _repo.GetContents(); int count = 0; //shows list of meal numbers foreach (KomodoCafeMenu content in listOfItems) { count++; Console.WriteLine($"{count}.{content.MealNum}"); } //prompt and select int targetMenuItem = int.Parse(Console.ReadLine()); int targetIndex = targetMenuItem - 1; if (targetIndex >= 0 && targetIndex < listOfItems.Count) { KomodoCafeMenu desiredContent = listOfItems[targetIndex]; if (_repo.DeleteContent(desiredContent.MealNum)) { Console.WriteLine($"Meal number {desiredContent.MealNum} was successfully removed"); } else { Console.WriteLine("Please enter a valid selection"); } } else { Console.WriteLine("That meal ID doesn't exist"); } Console.ReadKey(); }
private void AddMenuItem() { Console.Clear(); KomodoCafeMenu newMenuItem = new KomodoCafeMenu(); Console.WriteLine("Enter the meal number for the new menu item."); newMenuItem.MealNumber = int.Parse(Console.ReadLine()); Console.WriteLine("Enter the name of the new menu item."); newMenuItem.MealName = Console.ReadLine(); Console.WriteLine("Enter the description for the new menu item."); newMenuItem.Description = Console.ReadLine(); Console.WriteLine("Enter the ingredients for the new menu item."); newMenuItem.Ingredients = Console.ReadLine(); Console.WriteLine("Enter the price for the new menu item."); newMenuItem.Price = decimal.Parse(Console.ReadLine()); _menuList.AddMenuItemToList(newMenuItem); }
public void Arrange() { _repo = new KomodoCafeMenuRepository(); _menuItem = new KomodoCafeMenu(1, "burger", "a big burger", "burger ingredients", 7.03m); _repo.AddMenuItemToList(_menuItem); }