コード例 #1
0
        private void CreateNewItem()
        {
            Console.Clear();
            MenuItems newItem = new MenuItems();

            Console.WriteLine("Please assign a Meal Number to this item.");
            newItem.MealNumber = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("What is the name of the new menu item?");
            newItem.MealName = Console.ReadLine();

            Console.WriteLine($"Please describe {newItem.MealName}.");
            newItem.Description = Console.ReadLine();

            Console.WriteLine($"Please list the ingredients in {newItem.MealName}.");
            newItem.Ingredients = Console.ReadLine();

            Console.WriteLine($"How much will {newItem.MealName} cost?");
            newItem.Price = Convert.ToDouble(Console.ReadLine());

            _repo.AddItemsToMenu(newItem);
        }
コード例 #2
0
        public void AddToMenu_ShouldGetCorrectBoolean()
        {
            bool addResult = _repo.AddItemsToMenu(_item);

            Assert.IsTrue(addResult);
        }
コード例 #3
0
 public void Arrange()
 {
     _repo = new MenuItemsRepo();
     _item = new MenuItems(1, "Basic Burger combo", "A plain burger with a side of fries", "lettuce, tomato, pickles", 5);
     _repo.AddItemsToMenu(_item);
 }