示例#1
0
        public void AddToMenuShouldGetCorrectBoolean()
        {
            MenuItems      meal       = new MenuItems();
            MenuItems_repo repository = new MenuItems_repo();

            bool addResult = repository.AddToMenu(meal);

            Assert.IsTrue(addResult);
        }
        private void AddItemsToMenu()
        {
            Console.Clear();

            MenuItems newMeal = new MenuItems();

            Console.WriteLine("Please add a meal number.");
            string menuNuberAsString = Console.ReadLine();
            int    menuNumberAsInt   = int.Parse(menuNuberAsString);

            newMeal.MenuNumber = menuNumberAsInt;

            Console.WriteLine("Please add a name.");
            newMeal.Name = Console.ReadLine();

            Console.WriteLine("Please add a description.");
            newMeal.Description = Console.ReadLine();

            Console.WriteLine("Please list the ingredients.");
            newMeal.Ingredients = Console.ReadLine();

            Console.WriteLine("Please add the price.");
            string priceAsString = Console.ReadLine();
            double priceAsDouble = double.Parse(priceAsString);

            newMeal.Price = priceAsDouble;

            bool wasAdded = _menuItems.AddToMenu(newMeal);

            if (wasAdded == true)
            {
                Console.WriteLine("New meal successfully added to the menu.");
            }
            else
            {
                Console.WriteLine("Failed to add meal to the menu.");
            }
            Console.ReadLine();
        }