Example #1
0
        private void CreateNewMenuItems()
        {
            Console.Clear();
            MenuItem newMenuItem    = new MenuItem();
            var      ingredientList = new List <string>();

            Console.WriteLine("What is the new menu item?");
            newMenuItem.MealName = Console.ReadLine();
            Console.WriteLine("What is the description of this item?");
            newMenuItem.MealDescription = Console.ReadLine();
            Console.WriteLine("What is the price of this item?");
            newMenuItem.MealPrice = Convert.ToDecimal(Console.ReadLine());
            //string mealPriceAsString = Console.ReadLine();
            //double mealPriceAsDoulbe = Convert.ToDouble(mealPriceAsString);
            //newMenuItem.MealPrice = mealPriceAsDoulbe;
            Console.WriteLine("Enter ingredients of the item?(Enter 'stop' to quit)\n" +
                              "1. Bun\n" +
                              "2. Lettuce\n" +
                              "3. Meat\n" +
                              "4. Pickle\n" +
                              "5. Tomato\n" +
                              "6. Ketchup\n" +
                              "7. Mayo");
            string ingredient = Console.ReadLine();

            while (ingredient != "stop")
            {
                Console.Write("Ingredient Name: ");
                string input = Console.ReadLine();
                newMenuItem.IngredientList.Add(input);
            }
            _repo.AddItemsToMenu(newMenuItem);
        }
 public void Arrange()
 {
     _repo = new MenuItemRepository();
     _cafe = new MenuItem(1, "BurgerBuddy", "One Burger with another burger as its buddy.", 3.15M, new List <string> {
         "Meat", "Bun", "Cheese slice"
     });
     _repo.AddItemsToMenu(_cafe);
 }
        public void AddToMenu_ShouldGetCorrectBoolean()
        {
            MenuItem           cafe       = new MenuItem();
            MenuItemRepository repository = new MenuItemRepository();
            bool addResult = repository.AddItemsToMenu(cafe);

            Assert.IsTrue(addResult);
        }
        public void GetMenu_ShouldReturnCorrectCollection()
        {
            MenuItem           cafe       = new MenuItem();
            MenuItemRepository repository = new MenuItemRepository();

            repository.AddItemsToMenu(cafe);
            List <MenuItem> menu         = repository.GetAllMenuItems();
            bool            menuHasItems = menu.Contains(cafe);

            Assert.IsTrue(menuHasItems);
        }