Exemplo n.º 1
0
        private void CreateMenuItem()
        {
            Meal newMenuItem = new Meal();

            Console.Clear();
            Console.WriteLine("Please enter the name of the new menu item:");
            newMenuItem.Name = Console.ReadLine();

            Console.Clear();
            Console.WriteLine("Please enter the new menu item's description:");
            newMenuItem.Description = Console.ReadLine();

            Console.Clear();
            List <string> newMenuItemIngs = new List <string>();

            Console.WriteLine($"What ingredients are required to make {newMenuItem.Name}?");
            for (int i = 0; i < 3; i++)
            {
                Console.WriteLine("Please type an ingredient:");
                string newIng = Console.ReadLine();
                newMenuItemIngs.Add(newIng);
            }
            newMenuItem.Ingredients = newMenuItemIngs;

            Console.Clear();
            CreateNewMenuItemPrice(newMenuItem);

            Console.Clear();
            menu.CreateMeal(newMenuItem);
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("New Menu Item created!");
        }
        public void CreateMealTest()
        {
            for (int i = 0; i < 3; i++)
            {
                Meal mealTest = new Meal();
                mealTest.Name        = $"Test Meal {i}";
                mealTest.Description = "Test meal";
                List <string> testIngredients = new List <string> {
                    "Salt", "Sugar", "Flour"
                };
                mealTest.Ingredients = testIngredients;
                mealTest.Price       = 2.00M;

                menuTest.CreateMeal(mealTest);
            }

            Assert.AreEqual(3, menuTest.GetAllMeals().Count);
        }