// Create New Menu Item private void CreateNewMenuItem() { Console.Clear(); MenuItems newItem = new MenuItems(); // MenuNumber Console.WriteLine("Enter the menu number for the new item:"); string menuNumberAsString = Console.ReadLine(); newItem.MenuNumber = int.Parse(menuNumberAsString); // MenuName Console.WriteLine("Enter the menu name for the new item:"); newItem.MenuName = Console.ReadLine(); // MenuDescription Console.WriteLine("Enter a bref description for the new item:"); newItem.MenuDescription = Console.ReadLine(); // MenuIngredients Console.WriteLine("Enter the ingredients for the new item:"); newItem.MenuIngredients = Console.ReadLine(); // MenuPrice Console.WriteLine("Enter the price for the new item:"); string menuPriceAsString = Console.ReadLine(); newItem.MenuPrice = decimal.Parse(menuPriceAsString); _menuItemRepo.AddMenuItemToList(newItem); }
public void AddToListIncreasesCount() { // Arrange // Set up the necessary pieces to run our code MenuItems item = new MenuItems(1, "food", "beef", "cow", 5.00m); // Act // Run code we want to make sure works _repo.AddMenuItemToList(item); // Assert - ensure a condition // AreEqual - value you expect, value you got from the code int test = _repo.GetMenuItemsList().Count; Assert.AreEqual(1, test); }