public void CreateNewItem_ShouldReturnCorrect() { CafeMenu menuItem = new CafeMenu(); CafeMenuRepository repository = new CafeMenuRepository(); bool result = repository.CreateMenuItems(menuItem); Assert.IsTrue(result); }
public void ViewMenu_ShouldReturnFullMenu() { CafeMenu menuItem = new CafeMenu(); CafeMenuRepository repository = new CafeMenuRepository(); repository.CreateMenuItems(menuItem); List <CafeMenu> directory = repository.ViewMenu(); bool hasContent = directory.Contains(menuItem); Assert.IsTrue(hasContent); }
private void CreateMenuItems() { Console.Clear(); CafeMenu newMenuItem = new CafeMenu(); Console.WriteLine("What menu number would you like to assign this item?"); string numberAsString = Console.ReadLine(); double numberAsDouble = Convert.ToDouble(numberAsString); newMenuItem.MealNumber = numberAsDouble; Console.WriteLine("What would you like to call this menu item?"); newMenuItem.MealName = Console.ReadLine(); Console.WriteLine("Please provide a description for this menu item."); newMenuItem.MealDescription = Console.ReadLine(); Console.WriteLine("What ingredients are used for this item?"); newMenuItem.Ingredients = Console.ReadLine(); Console.WriteLine("What is the price for this item?"); string priceAsString = Console.ReadLine(); double priceAsDouble = Convert.ToDouble(priceAsString); newMenuItem.Price = priceAsDouble; bool wasAdded = _repo.CreateMenuItems(newMenuItem); if (wasAdded) { Console.WriteLine("The item was added to the menu correctly"); } else { Console.WriteLine("The item was not added to the menu"); } }
public void Arrange() { _repo = new CafeMenuRepository(); _cafeMenu = new CafeMenu("Grilled Cheese", 4, "Cheese and bread put into the toaster", "cheese, bread", 5); _repo.CreateMenuItems(_cafeMenu); }