Esempio n. 1
0
        public void TestRemove()
        {
            //Arrange
            //performed in Test Initialization

            // act
            TestMenuRepo.AddMenuItem(menuTest);
            bool result = TestMenuRepo.RemoveMenuItem("Donut");

            // assert
            Assert.IsTrue(result);
        }
Esempio n. 2
0
        //remove existing menu item
        private void DeleteExistingMenuItem()
        {
            ViewAllMenuItems();
            Console.WriteLine("\nEnter the item number of the item you'd like to remove:");

            int itemNo = int.Parse(Console.ReadLine());

            bool wasDeleted = _menuItemRepo.RemoveMenuItem(itemNo);

            if (wasDeleted)
            {
                Console.WriteLine("The menu item was successfully deleted.");
            }
            else
            {
                Console.WriteLine("The content could not be deleted.");
            }
        }
Esempio n. 3
0
        private void RemoveMenuItem()
        {
            Console.Clear();
            DisplayAllMenuItems();
            Console.WriteLine("Enter the number of the menu item to remove\n");
            string intAsString      = Validation.IntFromStringValidation();
            int    menuItemNumber   = int.Parse(intAsString);
            var    menuItemToRemove = _menuItemsRepo.GetMenuItemByNumber(menuItemNumber);

            Console.Clear();

            if (_menuItemsRepo.RemoveMenuItem(menuItemNumber))
            {
                Console.WriteLine($"\n{menuItemToRemove.NameOfMenuItem} was successfully removed from the menu.");
            }
            else
            {
                Console.WriteLine("\nThe menu item could not be removed.\n\n" +
                                  "Press any key to continue.");
                Console.ReadKey();
                UIMenu();
            }
        }
Esempio n. 4
0
        public void TestRemoveMenuItem()
        {
            bool deleteResult = _repo.RemoveMenuItem(menuItem1.NumberOfMenuItem);

            Assert.IsTrue(deleteResult);
        }
Esempio n. 5
0
 public void RemoveMenuItem()
 {
     menuOperations.RemoveMenuItem(2);
 }