public void DeleteMenuItems() { Console.Clear(); SeeFullMenu(); Console.WriteLine("Enter the number of the menu item for removal:"); string inputString = Console.ReadLine(); int input = int.Parse(inputString); bool isItemDeleted = _repoContent.RemoveItemFromList(input); if (isItemDeleted) { Console.Clear(); Console.WriteLine("The item was deleted"); Console.ReadLine(); } else { Console.Clear(); Console.WriteLine("Item could not be deleted"); Console.ReadLine(); } }
public void RemoveItemFromListTest() { // Arrange SeedItemList(); int realMealNum = 1; //Act MenuContent item = _testRepo.GetItemsByNumber(realMealNum); if (item == null) { Assert.Fail("Number does not exist in repository"); } else { _testRepo.RemoveItemFromList(realMealNum); } item = _testRepo.GetItemsByNumber(realMealNum); // Assert Assert.IsNull(item); }