public void TestForGetMealByNum() { //Arrange MealContentRepo repo = new MealContentRepo(); MealContent meal = new MealContent(5, "Turkey Breakfast", "Toast, turkey sausage, egg whites, wheat toast, and Milk.", 9, MealType.Breakfast); repo.AddMealToMenuList(meal); //Act MealContent mealByNum = repo.GetMealByMealNumber(meal.MealNumber); //Assert Assert.AreEqual(meal, mealByNum); }
public void TestForGetMealByNum2() { MealContentRepo mealTestRepo = new MealContentRepo(); //Extra test MealContent mealTestCont = new MealContent(); mealTestRepo.AddMealToMenuList(mealTestCont); //Act MealContent mealByNum = mealTestRepo.GetMealByMealNumber(mealTestCont.MealNumber); bool menuNumsAreEqual = mealTestCont.MealName == mealByNum.MealName; Assert.IsTrue(menuNumsAreEqual); }
private void SeeMealByNumber() { Console.Clear(); Console.WriteLine("Which meal number would you like to see?"); string mealAsString = Console.ReadLine(); int mealNumber = int.Parse(mealAsString); MealContent meal = _mealContentRepo.GetMealByMealNumber(mealNumber); if (meal != null) { Console.WriteLine($"Meal Number: {meal.MealNumber}\n" + $"Menu Type: {meal.TypeOfMeal}\n" + $"Meal Name: {meal.MealName}\n" + $"Description: {meal.MealDescription}\n" + $"Price: {meal.Price}"); } else { Console.WriteLine("No content by that title."); } }