//View existing meal by Meal Number private void DisplayMealByMealNumber() { Console.Clear(); //Prompt the user to give me an ID number Console.WriteLine("Enter the Meal Number for the meal that you'd like to see:"); int mealNumber = int.Parse(Console.ReadLine()); //Find the meal by that ID number KomodoMenu meal = _mealRepo.GetMealByMealNumber(mealNumber); //Display said meal if it isn't null if (meal != null) { Console.WriteLine($"Meal ID Number: {meal.MealNumber}\n" + $"Name: {meal.MealName}\n" + $"Description: {meal.MealDescription}\n" + $"Ingredients: {meal.ListOfIngredients}\n" + $"Price: {meal.MealPrice}\n" + $"Type of meal: {meal.TypeOfFood}"); } else { Console.WriteLine("\nNo meal by that ID Number..."); } }
public void AddToList_ShouldGetNotNull() { //Arrange --> Setting up the playing field KomodoMenu meal = new KomodoMenu(); meal.MealNumber = 9; KomodoMenuRepo repository = new KomodoMenuRepo(); //Act --> Get/run the code we want to test repository.AddMealToList(meal); KomodoMenu mealFromDirectory = repository.GetMealByMealNumber(9); //Assert --> Use the assert class to verify the expected outcome Assert.IsNotNull(mealFromDirectory); }