public void Arrange() { _repo = new MenuRepo(); _item = new Menu(1, "MeatLoaf", MealDiscription.SuperSaving, " Meatloaf with tomatoes, onions and green peppers", 10.99); _repo.AddItemsToMenu(_item); }
private void CreateNewMenu() { Console.Clear(); Menu newItem = new Menu(); //Meal Name Console.WriteLine("Enter the Meal Name: (MeatLoaf, Chicken Dumplins, Grilled Chicken Tender,Homestyle Chicken, chessesBurger"); newItem.MealName = Console.ReadLine(); // Meal Number Console.WriteLine("Enter the Meal Number (1,2,3,...)"); string starAsIntiger = Console.ReadLine(); //int Idnumber; //Int32.TryParse(starAsIntiger, out Idnumber); newItem.MealNumber = int.Parse(starAsIntiger); // Description Console.WriteLine("Enter the Meal Description :\n" + "1. Super Saving\n" + "2. Best for Two\n" + "3. Dinner Special \n" + "4. Our Signature \n" + "5. Most popular\n"); string descriptionAsString = Console.ReadLine(); // take string description and Parse to int (to use the numbers) int descriptionAsInt = int.Parse(descriptionAsString); // Pase description from string to Int newItem.Description = (MealDiscription)descriptionAsInt; //Casting take one object and cast it to different type. // Ingredients Console.WriteLine("Enter the Meal Ingreadiet: ( Chicken, Beef, Carrot , Corn, Mash potato, buttermilk Biscuits, "); newItem.Ingredients = Console.ReadLine(); // Price Console.WriteLine(" Enter the Meal price $10.59,$15.99.."); string starsAsString = Console.ReadLine(); newItem.Price = double.Parse(starsAsString); _itemRepo.AddItemsToMenu(newItem); }
public void AddItemToList_ShouldGetNotNull() { // Arrange Menu item = new Menu(); item.MealName = "MeatLoaf"; MenuRepo repo = new MenuRepo(); //Act repo.AddItemsToMenu(item); Menu itemFromDirectory = repo.GetItemByMealName("MeatLoaf"); //Assert Assert.IsNotNull(itemFromDirectory); }