コード例 #1
0
        public void AddToCafeMenu_MenuItemNotNull()
        {
            CafeMenu menuItem = new CafeMenu();

            menuItem.MealName = "Roast Beef Sandwich";
            CafeRepo repo = new CafeRepo();

            repo.AddToCafeMenu(menuItem);
            CafeMenu menuItemByMealName = repo.SearchMealByName("Roast Beef Sandwich");

            Assert.IsNotNull(menuItemByMealName);
        }
コード例 #2
0
        private void AddToCafeMenu()
        {
            Console.Clear();
            CafeMenu newMenuItem = new CafeMenu();

            Console.WriteLine("Enter a name for the new meal: ");
            newMenuItem.MealName = Console.ReadLine();
            Console.WriteLine("Enter a description for the new meal: ");
            newMenuItem.Description = Console.ReadLine();
            Console.WriteLine("Assign a combo number to the new meal: ");
            string MealNumberString = Console.ReadLine();

            newMenuItem.MealNumber = int.Parse(MealNumberString);
            Console.WriteLine("Enter the ingredients included in the new meal items: ");
            newMenuItem.Ingredient = Console.ReadLine();
            Console.WriteLine("Enter a price of the new meal: ");
            string PriceString = Console.ReadLine();

            newMenuItem.Price = double.Parse(PriceString);
            _cafeRepo.AddToCafeMenu(newMenuItem);
        }