コード例 #1
0
        private void ExistingItems()
        {
            Console.Clear();
            MenuItem burger  = new MenuItem(1, "Big Burger", "The biggest burger in the world, maybe.", "beef, bread, cheese, lettuce, tomato, pickles", 11.50);
            MenuItem nachos  = new MenuItem(2, "ZEE Nachos", "They are ZEE Best!", "tortilla chips, grilled chicken, grilled veggies, lettuce, shredded cheese, pico de gallo", 9.75);
            MenuItem corndog = new MenuItem(3, "CornDog", "I'd order two because they are that good", "deliciousness, fluffiness, hope, restoration in humanity", 5.25);

            _repo.AddMenuItem(burger);
            _repo.AddMenuItem(nachos);
            _repo.AddMenuItem(corndog);
        }
コード例 #2
0
        public void AddMenuItem_ShouldGetNotNull()
        {
            CafeContent cereal = new CafeContent(2, "Cereal", "Sugary puffed wheat in milk.", _listOfIngredients, 4.99);

            _repo.AddMenuItem(cereal);

            Assert.IsNotNull(cereal);
        }
コード例 #3
0
        public void DefaultValues()
        {
            _repo     = new CafeRepo();
            _iRepo    = new IngredientsRepo();
            _iContent = new IngredientsContent("bread");

            _listOfIngredients.Add(_iContent);
            _content = new CafeContent(1, "Grilled Cheese", "Melted cheese between two pieces of sourdough.", _listOfIngredients, 5.99);

            _repo.AddMenuItem(_content);
        }
コード例 #4
0
        public void AddItemsTest()
        {
            //Arrange ----> setting what is needed for our method to work
            CafeRepo newRepo = new CafeRepo();
            MenuItem item    = new MenuItem();
            //ACT --> call the method
            bool result = newRepo.AddMenuItem(item);

            //Assert
            Assert.IsTrue(result);
        }
コード例 #5
0
        private void AddMenuItem()
        {
            Console.Clear();
            CafeContent newMeal = new CafeContent();

            Console.WriteLine("What is the meal number to be assigned:");
            string mealNumber = Console.ReadLine();

            newMeal.MealNumber = int.Parse(mealNumber);

            Console.WriteLine("What is the name of this meal:");
            newMeal.MealName = Console.ReadLine();

            Console.WriteLine("Description of the meal:");
            newMeal.Description = Console.ReadLine();

            Console.WriteLine("Price of Meal: (ex:14.99)");
            string price = Console.ReadLine();

            newMeal.Price = double.Parse(price);

            _cafeRepo.AddMenuItem(newMeal);
        }
コード例 #6
0
        public void GetList_Test()
        {
            //Arrange
            MenuItem item    = new MenuItem();
            CafeRepo newRepo = new CafeRepo();

            newRepo.AddMenuItem(item);
            //ACT
            List <MenuItem> items    = newRepo.GetList();
            bool            hasItems = items.Contains(item);

            //Assert
            Assert.IsTrue(hasItems);
        }
コード例 #7
0
        public void RemoveItem_Test()
        {
            //Arrange what is needed for method to work
            CafeRepo        _cafeRepo = new CafeRepo();
            List <MenuItem> items     = _cafeRepo.GetList();
            MenuItem        item      = new MenuItem();

            //ACT ---> Call Method
            _cafeRepo.AddMenuItem(item);
            bool remove       = _cafeRepo.DeleteExistingItem(item);
            bool doesHaveItem = items.Contains(item);

            //ASSERT
            Assert.IsFalse(doesHaveItem);
        }