示例#1
0
        private void CreateNewItem()
        {
            Console.Clear();
            MenuPoco newItem = new MenuPoco();

            Console.WriteLine("Enter the item's name:");
            newItem.MealName = Console.ReadLine();

            Console.WriteLine("Enter the item's number:");
            string mealNumberAsString = Console.ReadLine();

            newItem.MealNumber = int.Parse(mealNumberAsString);

            Console.WriteLine("Enter the item's description:");
            newItem.MealDescription = Console.ReadLine();

            Console.WriteLine("Enter the item's list of ingredients:");
            newItem.IngredientsList = Console.ReadLine();

            Console.WriteLine("Enter the item's price:");
            string mealPriceAsString = Console.ReadLine();

            newItem.MealPrice = double.Parse(mealPriceAsString);

            _itemRepo.AddItemToList(newItem);
        }
        public void GetThisPartyStarted()
        {
            _repo = new MenuRepo();
            _item = new MenuPoco(1, "Pig's feet", "Braised with pig's blood, and served with a side of roasted pig testicles and boiled intestines, it's sure to delight!", "Feet, eyes, intestines", 11.50);

            _repo.AddItemToList(_item);
        }
        public void AddToList_ShouldGetNotNull()
        {
            //Arrange
            MenuPoco item = new MenuPoco();                                             //new up

            item.MealName = "Anchovie Icecream";                                        //set
            MenuRepo repo = new MenuRepo();                                             //new up

            //Act
            repo.AddItemToList(item);                                                   //add
            MenuPoco itemFromDirectory = repo.GetItemByName("Anchovie Icecream");       //get

            //Assert
            Assert.IsNotNull(itemFromDirectory);                                        //verify
        }