public void DeletedContent_ShouldBeDeleted() { bool wasRemoved = _repo.DeleteContent(1); Assert.IsTrue(wasRemoved); // bool wasAlsoRemoved = _repo.DeleteContent(2); // Assert.IsFalse(wasAlsoRemoved); }
//case 2 private void RemoveFromMenu() { Console.Clear(); Console.WriteLine("What is the number of the item you'd like to remove?"); List <KomodoCafeMenu> listOfItems = _repo.GetContents(); int count = 0; //shows list of meal numbers foreach (KomodoCafeMenu content in listOfItems) { count++; Console.WriteLine($"{count}.{content.MealNum}"); } //prompt and select int targetMenuItem = int.Parse(Console.ReadLine()); int targetIndex = targetMenuItem - 1; if (targetIndex >= 0 && targetIndex < listOfItems.Count) { KomodoCafeMenu desiredContent = listOfItems[targetIndex]; if (_repo.DeleteContent(desiredContent.MealNum)) { Console.WriteLine($"Meal number {desiredContent.MealNum} was successfully removed"); } else { Console.WriteLine("Please enter a valid selection"); } } else { Console.WriteLine("That meal ID doesn't exist"); } Console.ReadKey(); }