private void AddNewMenuItem() { Console.Clear(); Menu newItem = new Menu(); Console.WriteLine("What Number will this Item be on the menu?:"); string inputAsString = Console.ReadLine(); newItem.MealNumber = int.Parse(inputAsString); Console.WriteLine("Enter the name of the item you are adding to the menu:"); newItem.MealName = Console.ReadLine(); Console.WriteLine("Enter the description of new menu item:"); newItem.Desc = Console.ReadLine(); Console.WriteLine("Enter the ingredients of the new menu item:"); newItem.Ingredients = Console.ReadLine(); Console.WriteLine("Enter the Price of the new menu item:"); string priceAsString = Console.ReadLine(); newItem.Price = double.Parse(priceAsString); _menuRepo.AddItemToMenu(newItem); }
public void Arrange() { _repo = new MenuRepo(); _items = new Menu(3, "Mac N Cheese", "Creamy goodness", "noodles, cheese", 3.66); _repo.AddItemToMenu(_items); }
public void AddItems() { //Arrange MenuRepo repo = new MenuRepo(); //----> new object of MenuRepo MenuItem hotDog = new MenuItem("Hot Dog", 1, "It's a hot dog.", "Bun, hotdog, mustard, relish", 1.00d); //Act repo.AddItemToMenu(hotDog); List <MenuItem> listOfItemOnMenu = repo.GetMenuItems(); //Assert bool foundItem = false; foreach (MenuItem item in listOfItemOnMenu) { if (item.ItemName == hotDog.ItemName) { Console.WriteLine($"{item.ItemNumber}. {item.ItemName}\n" + $"{item.Description}"); foundItem = true; break; } } Assert.IsTrue(foundItem); }
public void MyAddItemTestMethod() { MenuItem item = new MenuItem(); MenuRepo repository = new MenuRepo(); bool addResult = repository.AddItemToMenu(item); Assert.IsTrue(addResult); }
public void AddItemToMenu_ShouldGeCorrectBool() { MenuContent content = new MenuContent();//content is a new object created for arrange part MenuRepo repo = new MenuRepo(); bool addItem = repo.AddItemToMenu(content); Assert.IsTrue(addItem); }
public void GetMenu_ShouldReturnCorrectMenu() { MenuContent testContent = new MenuContent(); MenuRepo repo = new MenuRepo(); repo.AddItemToMenu(testContent); List <MenuContent> testList = repo.GetMenu(); bool menuHasContent = testList.Contains(testContent); }
public void Arrange() { List <string> mondayDailySlice = new List <string>() { "dough, parm, mozz, red sauce, red onion, mushroom" }; _repo = new MenuRepo(); _item = new MenuItem(1, "Monday Daily Slice", "Mushroom and onion slice", mondayDailySlice, 3.5); _repo.AddItemToMenu(_item); }
public void AddToMenuSouldntGetNull() { Menu item = new Menu(); item.MealName = "Brisket"; MenuRepo repos = new MenuRepo(); repos.AddItemToMenu(item); Menu itemFromDirectory = repos.GetItemByName("Brisket"); Assert.IsNotNull(itemFromDirectory); }
public void GetAllItems_ShouldReturnCollection() { MenuItem item = new MenuItem(); MenuRepo repo = new MenuRepo(); repo.AddItemToMenu(item); List <MenuItem> items = repo.GetAllItems(); bool directoryHasContent = items.Contains(item); Assert.IsTrue(directoryHasContent); }
public void AddItemToMenu() { Console.Clear(); MenuContent newContent = new MenuContent(); Console.WriteLine("What number would you like to assign to this Meal?"); newContent.MealNumber = int.Parse(Console.ReadLine()); Console.WriteLine("\nWhat is the name for this Meal?"); newContent.Name = Console.ReadLine(); Console.WriteLine("\nAdvise the description of the Meal?"); newContent.Description = Console.ReadLine(); Console.WriteLine("\nAdvise the ingredients for this Meal?"); newContent.Ingredients = Console.ReadLine(); Console.WriteLine("\nWhat will be the price for this Meal-Enter your $ Amount?"); newContent.Price = int.Parse(Console.ReadLine()); Console.WriteLine($"{newContent} will be added to the Menu. Press any key to continue..."); _menuRepository.AddItemToMenu(newContent); Console.ReadLine(); }
public void AddToMenu_ShouldGetNonNull() { // Arrange Menu menuItem = new Menu(); menuItem.MealNumber = "4"; //Act MenuRepo repo = new MenuRepo(); repo.AddItemToMenu(menuItem); Menu itemFromMenu = repo.GetMenuItemByMealNumber("4"); //Assert Assert.IsNotNull(itemFromMenu); }
public void AddNewItemToMenu() { Console.Clear(); Menu newMeal = new Menu(); Console.WriteLine("Enter the number for the menu item:"); string numberAsString = Console.ReadLine(); newMeal.Number = int.Parse(numberAsString); Console.WriteLine("Enter the name for the menu item:"); newMeal.Name = Console.ReadLine(); Console.WriteLine("Enter a description for the menu item:"); newMeal.Description = Console.ReadLine(); Console.WriteLine("Enter the ingredients for the menu item:"); newMeal.IngredientsList.Add(Console.ReadLine()); Console.WriteLine("Enter a price for the menu item:"); string priceAsString = Console.ReadLine(); newMeal.Price = decimal.Parse(priceAsString); menuRepo.AddItemToMenu(newMeal); }
//Case 1 public void AddItem() { Console.Clear(); MenuItem newItem = new MenuItem(); //Item Name Console.WriteLine("What is the item name?"); newItem.ItemName = Console.ReadLine(); //Item Number Console.WriteLine("What is the item number?"); string newItemNumber = Console.ReadLine(); int itemNumber = int.Parse(newItemNumber); newItem.ItemNumber = (int)itemNumber; //Item Description Console.WriteLine("Description of item."); newItem.Description = Console.ReadLine(); //Item Ingredients Console.WriteLine("List ingredients in item."); newItem.Ingredients = Console.ReadLine(); //Item Price ---> an int can be a double so it works Console.WriteLine("What is the price of the item"); string newItemPrice = Console.ReadLine(); int itemPrice = int.Parse(newItemPrice); newItem.Price = (int)itemPrice; //This adds item to repo so UI will remember the new item //references the method in repo that actually adds the new item _menuRepo.AddItemToMenu(newItem); }
public void Arrange() { _menu = new Menu("1", "Hamburger", "The classic hamburger and a crowd favorite", "Bun, Hamburger, Lettuce, Tomato", "$4.95"); _repo = new MenuRepo(); _repo.AddItemToMenu(_menu); }