示例#1
0
        public void AddToListNotNull()
        {
            //Arrange
            Meal meal = new Meal();

            meal.MealName = "Salad";
            CafeRepo cafe = new CafeRepo();

            //Act
            cafe.AddMealToMenu(meal);
            Meal mealFromDirectory = cafe.GetMealByMealName("Salad");

            //Assert
            List <Meal> meaDirectory = cafe.GetListOfMeals();

            Assert.IsNotNull(mealFromDirectory);
        }
示例#2
0
        //View menu By Meal Name
        private void ViewMenuByMealName()
        {
            Console.Clear();
            Console.WriteLine("Please enter the Meal number you like to order:");
            string mealName = Console.ReadLine();
            Meal   newMeal  = _cafeRepo.GetMealByMealName(mealName);

            if (newMeal != null)
            {
                Console.WriteLine($"Meal: {newMeal.MealNumber}\n" +
                                  $"Meal Name: {newMeal.MealName}" +
                                  $"Description: {newMeal.Description}\n" +
                                  $"Price: {newMeal.Price}\n" +
                                  $"Our Menu: {newMeal.ourMenu}\n" +
                                  $"Ingredients: {newMeal.Ingredients}");
            }

            else
            {
                Console.WriteLine("There is no menu name by that name");
            }
        }