コード例 #1
0
        public void MenuItemsRepository_RemovedOrderedItem_ShouldRemoveItem()
        {
            //Arrange
            MenuItems_Repository menuItems = new MenuItems_Repository();

            MenuItems cheeseburger = new MenuItems();

            menuItems.AddMenuItemList(cheeseburger);

            menuItems.RemoveOrderedItem(cheeseburger.MealName);

            //Act
            int actual   = menuItems.GetMenuRepositoryList().Count;
            int expected = 0;

            //Assert
            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void MenuItemsRepository_ShouldAddItemToList()
        {
            //Arrange
            MenuItems_Repository menuItems    = new MenuItems_Repository();
            MenuItems            cheeseburger = new MenuItems();
            MenuItems            item         = new MenuItems();
            MenuItems            coocoocacho  = new MenuItems();

            menuItems.AddMenuItemList(item);
            menuItems.AddMenuItemList(cheeseburger);
            menuItems.AddMenuItemList(coocoocacho);


            //Act
            int actual   = menuItems.GetMenuRepositoryList().Count;
            int expected = 3;

            //Assert
            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void MenuItemsRepository_FindItemsByName_ShouldFunctionCorrectly()
        {
            //Arrange
            MenuItems_Repository menuItems = new MenuItems_Repository();

            MenuItems cheeseburger = new MenuItems();
            MenuItems item         = new MenuItems();
            MenuItems coocoocacho  = new MenuItems();

            menuItems.AddMenuItemList(cheeseburger);
            menuItems.AddMenuItemList(item);
            menuItems.AddMenuItemList(coocoocacho);


            menuItems.FindItemsByName(cheeseburger.MealName);

            //Act
            MenuItems actual   = menuItems.FindItemsByName(cheeseburger.MealName);
            MenuItems expected = cheeseburger;

            //Assert
            Assert.AreEqual(expected, actual);
        }