public void Seed()
        {
            _repo = new MenuItem_Repo();
            MenuItem burger = new MenuItem(1, "Burgee", "Big ol burger", "burger stuff", 3.50);

            _repo.AddItemToMenuDirectory(burger);

            _item = new MenuItem(8, "BlamWhich", "KaBlam", "100% Blam", 15);
            _repo.AddItemToMenuDirectory(_item);
        }
Esempio n. 2
0
        public void AddToRepo_ShouldGetCorrectBool() //Create
        {
            //Arrange
            MenuItem      item = new MenuItem();
            MenuItem_Repo menu = new MenuItem_Repo();
            //Act
            bool addResult = menu.AddMenuItem(item);

            //Assert
            Assert.IsTrue(addResult);
        }
Esempio n. 3
0
        public void GetMenu_ShouldReturnCorrectCollection()//Read
        {
            //Arrange
            MenuItem      item = new MenuItem();
            MenuItem_Repo menu = new MenuItem_Repo();

            menu.AddMenuItem(item);
            //Act
            List <MenuItem> menuItems    = menu.GetMenu();
            bool            menuHasItems = menuItems.Contains(item);

            //Assert
            Assert.IsTrue(menuHasItems);
        }
Esempio n. 4
0
        public void AddToMenu()
        {
            MenuItem item = new MenuItem();

            item.MealNumber = 1;

            MenuItem_Repo repo = new MenuItem_Repo();

            repo.AddItemToDirectory(item);

            MenuItem itemFromDirectory = repo.GetMealByNum(1);

            Assert.IsNotNull(itemFromDirectory);
        }
Esempio n. 5
0
        public void GetMenuByMealNum_ShouldReturnCorrectMenuItem()//Read
        {
            //Arrange
            MenuItem_Repo menu = new MenuItem_Repo();
            MenuItem      item = new MenuItem(01,
                                              "Burger and Fries",
                                              "Our delicious all beef burger and a medium fry",
                                              "Bun, Burger, Pickles, Onion, Lettuce, Tomato, Fries",
                                              8);

            menu.AddMenuItem(item);
            int mealNum = 01;
            //Act
            MenuItem searchResult = menu.GetMenuItemByMealNum(mealNum);

            //Assert
            Assert.AreEqual(searchResult.MealNumber, mealNum);
        }
Esempio n. 6
0
        public void DeleteMenuItem_ShouldReturnTrue() //Delete
        {
            //Arrange
            MenuItem_Repo menu = new MenuItem_Repo();
            MenuItem      item = new MenuItem(01,
                                              "Burger and Fries",
                                              "Our delicious all beef burger and a medium fry",
                                              "Bun, Burger, Pickles, Onion, Lettuce, Tomato, Fries",
                                              8);

            menu.AddMenuItem(item);
            int mealNum = 01;

            //Act
            MenuItem oldItem      = menu.GetMenuItemByMealNum(mealNum);
            bool     removeResult = menu.DeleteMenuItem(oldItem);

            //Assert
            Assert.IsTrue(removeResult);
        }
Esempio n. 7
0
        public void UpdateExistingMenuItem_ShouldReturnTrue() //Update
        {
            //Arrange
            MenuItem_Repo menu    = new MenuItem_Repo();
            MenuItem      oldItem = new MenuItem(01,
                                                 "Burger and Fries",
                                                 "Our delicious all beef burger and a medium fry",
                                                 "Bun, Burger, Pickles, Onion, Lettuce, Tomato, Fries",
                                                 8);

            menu.AddMenuItem(oldItem);
            MenuItem newItem = new MenuItem(02,
                                            "Bacon Cheese Burger and Fries",
                                            "Our delicious all beef burger and a medium fry",
                                            "Bun, Burger, Bacon, Cheese, Pickles, Onion, Lettuce, Tomato, Fries",
                                            10);
            //Act
            bool updateResult = menu.UpdateExistingMenuItem(oldItem.MealNumber, newItem);

            //Assert
            Assert.IsTrue(updateResult);
        }