예제 #1
0
        private void CreateNewMenuContent()
        {
            Console.Clear();
            MenuContent newContent = new MenuContent();

            Console.WriteLine("Enter the name of the menu item:");
            newContent.MealName = Console.ReadLine();

            Console.WriteLine("Please enter the description for the menu item:");
            newContent.Description = Console.ReadLine();

            Console.WriteLine("Enter the ingredients of the menu item:");
            string ingredientsAsString = Console.ReadLine();

            newContent.Ingredients = ingredientsAsString;

            Console.WriteLine("Please enter the price of the menu item");
            string priceAsString = Console.ReadLine();

            newContent.Price = double.Parse(priceAsString);

            Console.WriteLine("Please enter the meal # of menu item.");
            string menuNumAsString = Console.ReadLine();

            newContent.MealNumber = int.Parse(menuNumAsString);
            Console.WriteLine("");

            _menuRepo.AddContentToMenu(newContent);
            Console.WriteLine("Press any key to continue");
        }
예제 #2
0
        public void Arrange()
        {
            _repo    = new MenuContentRepo();
            _content = new MenuContent("Hibachi Steak", "Marinated steak with fried rice, sauteed vegetable," +
                                       "fried rice, and miso soup.", "steak, rice, brocolli, carrots, tofu", 18.99, 5);

            _repo.AddContentToMenu(_content);
        }
예제 #3
0
        public void AddToMenu_ShouldAddToList()
        {
            MenuContent     content = new MenuContent();
            MenuContentRepo repo    = new MenuContentRepo();

            //Act
            bool addResult = repo.AddContentToMenu(content);

            //Assert
            Assert.IsTrue(addResult);
        }
예제 #4
0
        public void GetMenuContent_ShouldReturnCorrectCollection()
        {
            //Arrange
            MenuContent     content = new MenuContent();
            MenuContentRepo repo    = new MenuContentRepo();

            repo.AddContentToMenu(content);

            //Act
            List <MenuContent> contents = repo.GetMenuContentList();

            bool repoHasContent = contents.Contains(content);

            //Assert!
            Assert.IsTrue(repoHasContent);
        }