public void GetAllMenuItems_ShouldReturnNotNull()
        {
            var repo = new CafeRepo();
            var item = new MenuItem();

            repo.AddNewMenuItem(item);
            List <MenuItem> getMenu = repo.GetAllMenuItems();

            Assert.IsNotNull(getMenu);
        }
Beispiel #2
0
        public void GetAllMenuItems_ShouldReturnListOfMenuItems()
        {
            MenuItem content = new MenuItem();
            CafeRepo repo    = new CafeRepo();

            repo.AddMenuItemToRepository(content);
            List <MenuItem> fullRepo = repo.GetAllMenuItems();

            bool directoryHasContents = fullRepo.Contains(content);

            Assert.IsTrue(directoryHasContents);
        }
        private void DisplayAll()
        {
            Console.WriteLine("Meal Number\tMeal Name\tDescription\tPrice\tIngredients");
            List <MenuItem> currentList = _cafeRepo.GetAllMenuItems();

            foreach (MenuItem current in currentList)
            {
                Console.WriteLine($"{current.MealNumber}\t{current.MealName}\t{current.Description}\t{current.Price}\t");
                foreach (string ingredient in current.Ingredients)
                {
                    Console.Write($"{ingredient}, ");
                }
            }

            Console.WriteLine("\nPress any key to continue...");
            Console.ReadKey();
        }
        public void ViewAllMenuItems()
        {
            List <MenuItem> allMenuItems = new List <MenuItem>();

            allMenuItems = menu.GetAllMenuItems();
            foreach (MenuItem item in allMenuItems)
            {
                Console.WriteLine($"Meal Number: {item.MealNumber}\n" +
                                  $"Item Name: {item.MealName}\n" +
                                  $"Description: {item.Description}");
                foreach (string ingredient in item.Ingredients)
                {
                    Console.WriteLine($"Ingredients: {ingredient}");
                }
                Console.WriteLine($"Price: ${item.Price}\n" +
                                  $"");
            }
            Console.WriteLine("Press any key to return to main menu.");
            Console.ReadKey();
            Console.Clear();
            MainMenu();
        }