Esempio n. 1
0
        public void AddToMenu_ShouldGetNotNull()
        {
            List <string> ingredientsForOCM = new List <string> {
                "orange rind", "dried cranberries", "flour", "sugar", "salt"
            };

            Menu item2 = new Menu(2, "Orange Cranberry Muffin", "A delicious muffin packed with orange and cranberry flavours",
                                  ingredientsForOCM, 2.99);

            _repo.AddNewMenuItem(item2);
            Menu itemFromMenu = _repo.GetMenuItemByNumber(2);

            Assert.IsNotNull(itemFromMenu);
        }
Esempio n. 2
0
        private void DisplayMenuItemByNumber()
        {
            Console.Clear();
            Console.WriteLine("Please input the number of the item you would like to view:");
            int  menuNum = int.Parse(Console.ReadLine());
            Menu item    = _menuRepo.GetMenuItemByNumber(menuNum);

            if (item != null)
            {
                Console.WriteLine($"Number:{item.MealNumber}\n" +
                                  $"Name:{item.MealName}\n" +
                                  $"Description:{item.Description}\n" +
                                  $"Ingredients:{item.Ingredients}\n" +
                                  $"Price: ${item.Price}");
            }
            else
            {
                Console.WriteLine("There is no menu item with that number.");
            }
            Console.ReadKey();
        }