public void GetMealsShouldReturnMeals() { _repo = new MealsRepository(); _mealList = new List <Meal>(); _meal = new Meal(3, "Taco", "Real good. Makes ya full", 4.20); _mealList.Add(_meal); var chicken = _repo.GetMeals(); Assert.IsNotNull(chicken); }
public void RemoveMealsFromMenu() { Meals menuThree = new Meals(); menuThree.MealNumber = 1; MealsRepository repository = new MealsRepository(); repository.RemoveMealsFromMenu(menuThree.MealNumber); Assert.IsNotNull(repository); }
public void RemoveMenuItemRemovesMenuItem() { MealsRepository repo = new MealsRepository(); Meal meal = new Meal(3, "burger", "good", 2.50); repo.AddMenuItem(meal); var num = meal.MealNumber; bool removesResult = repo.RemoveMenuItem(num); Assert.IsTrue(removesResult); }
public void AddMealsToList_ShouldNotNull() { Meals menuTwo = new Meals(); menuTwo.MealName = "Taco"; MealsRepository repository = new MealsRepository(); //This is what we are testing below repository.AddMealsToList(menuTwo); // Assert.IsNotNull(repository.GetAllMeals()); Assert.IsTrue(repository.GetAllMeals().Contains(menuTwo)); }
public void AddMethodShouldAddMeal() //Also tests get item by ID { MealsRepository repo = new MealsRepository(); Meal meal = new Meal(3, "burger", "good", 2.50); repo.AddMenuItem(meal); repo.GetItemByID(meal.MealNumber); List <Meal> mealList = repo.GetMeals(); //GetMeals returns a list. We are returning the list, and then assigning it a name. bool mealListHasMeal = mealList.Contains(meal); // Is it true that meal list now contains meal? Assert.IsTrue(mealListHasMeal); }
public void REPO_MenuItemShouldBeAdded() { ///Arrange -- Setting up the playing field _meal = new Meal(3, "Taco", "Real good. Makes ya full", 4.20); _repo = new MealsRepository(); //Act -- Get or run the code we want to test _repo.AddMenuItem(_meal); //Assert -- using the Assert class to verify the expected outcome. Assert.IsNotNull(_meal.MealDescription); }
//Test Helper Method public void GetMealByNumber_ShouldNotNull() { //Arrange ---> setting up the plain field Meals menuOne = new Meals(); menuOne.MealNumber = 1; MealsRepository repository = new MealsRepository(); //Act ---> Get/RuntimeArgumentHandle the code we want to Test repository.AddMealsToList(menuOne); Meals menuFromList = repository.GetMealByNumber(1); //Assert---> Use the assert class to verify the expected outcome Assert.IsNotNull(menuFromList); }
public MealPlanController(MealPlanRepository mealPlanRepository, MealsRepository mealsRepository) { _mealPlanRepository = mealPlanRepository; _mealsRepository = mealsRepository; }
public MealsController(MealsRepository mealRepository, IngredientsRepository ingredientsRepository) { _mealRepository = mealRepository; _ingredientsRepository = ingredientsRepository; }