Пример #1
0
        private void RemoveMealFromMenu()
        {
            Console.Write("Please enter the name of the meal you would like to remove: ");
            CafeMeal meal = _menuRepo.GetMealByName(Console.ReadLine());

            _menuRepo.RemoveMeal(meal);
        }
Пример #2
0
        private void AddMenuItem()
        {
            //MealNumber = mealNumber;
            Console.WriteLine("What is the meal number?");
            int mealNumber = int.Parse(Console.ReadLine());

            //MealName = mealName;
            Console.WriteLine("What is the meal name?");
            string mealName = Console.ReadLine();

            //MealDescription = mealDescription;
            Console.WriteLine("Describe the meal, please.");
            string mealDescription = Console.ReadLine();

            //ListOfIngredients = listOfIngredients;
            Console.WriteLine("Write the Ingredients");
            string listOfIngredients = Console.ReadLine();

            //MealPrice = mealPrice;
            Console.WriteLine("What is the price of this meal?");
            decimal mealPrice = decimal.Parse(Console.ReadLine());

            CafeMeal order = new CafeMeal(mealNumber, mealName, mealDescription, listOfIngredients, mealPrice);

            _menuRepo.AddMenuItem(order);
        }
Пример #3
0
        public void GetMealByNameTest()
        {
            _menuRepo.AddNewMeal(_meal);
            CafeMeal expected = new CafeMeal("Big Mac", 1, "tastes real good", "a few tasty things between buns", 5);
            CafeMeal actual   = _menuRepo.GetMealByName("big mac");

            Assert.AreEqual(expected.Description, actual.Description);
        }
Пример #4
0
        private void CreateAndAddNewMeal()
        {
            CafeMeal meal = new CafeMeal();

            Console.Write("Please enter a meal name: ");
            meal.Name = Console.ReadLine();

            Console.Write("Please enter a meal number: ");
            meal.Number = int.Parse(Console.ReadLine());

            Console.Write("Please enter a meal description: ");
            meal.Description = Console.ReadLine();

            Console.Write("Please enter all ingredients used in the meal: ");
            meal.Ingredients = Console.ReadLine();

            Console.Write("Please enter the price of the meal: ");
            meal.Price = decimal.Parse(Console.ReadLine());

            _menuRepo.AddNewMeal(meal);
        }
Пример #5
0
        public void AddTest()
        {
            //Arrange - 'new up' here
            MenuRepository menuRepo = new MenuRepository();

            CafeMeal content = new CafeMeal(1, "Roast Beef Combo", "Meat Burger and Fries", "Bun, burger, fries, special sauce", 9.99m);

            //Act
            //MenuRepository
            menuRepo.AddMenuItem(content);
            List <CafeMeal> list = menuRepo.GetMenuItems();
            ////List<CafeMeal> list = MenuRepository


            //expect //actual
            int expected = 1;
            ///content.count; need to count list
            int actual = list.Count;

            //Assert
            Assert.AreEqual(expected, actual);
        }
Пример #6
0
 public void Arrange()
 {
     _menuRepo = new MenuRepo();
     _meal     = new CafeMeal("Big Mac", 1, "tastes real good", "a few tasty things between buns", 5);
 }