/// <summary> /// // 1. Create Meals /// </summary> private void CreateNewMeal() { Console.Clear(); Meals mealMenu = new Meals(); //MealNumber Console.WriteLine("What is the Meal Number"); mealMenu.MealNumber = int.Parse(Console.ReadLine()); //MealName Console.WriteLine("What is the Name of the Meal"); mealMenu.MealName = Console.ReadLine(); //Meal Description Console.WriteLine("What is the Description of this Meal"); mealMenu.Description = Console.ReadLine(); //List of Ingrediants Console.WriteLine("List of Ingredients"); mealMenu.ListOfIngredients = Console.ReadLine(); //Meal Price Console.WriteLine("List the Price of the Meal"); mealMenu.MealPrice = double.Parse(Console.ReadLine()); _meals.AddMealsToList(mealMenu); }
public void AddMealsToList_ShouldNotNull() { Meals menuTwo = new Meals(); menuTwo.MealName = "Taco"; MealsRepository repository = new MealsRepository(); //This is what we are testing below repository.AddMealsToList(menuTwo); // Assert.IsNotNull(repository.GetAllMeals()); Assert.IsTrue(repository.GetAllMeals().Contains(menuTwo)); }
//Test Helper Method public void GetMealByNumber_ShouldNotNull() { //Arrange ---> setting up the plain field Meals menuOne = new Meals(); menuOne.MealNumber = 1; MealsRepository repository = new MealsRepository(); //Act ---> Get/RuntimeArgumentHandle the code we want to Test repository.AddMealsToList(menuOne); Meals menuFromList = repository.GetMealByNumber(1); //Assert---> Use the assert class to verify the expected outcome Assert.IsNotNull(menuFromList); }