public void GetAll_DatabaseEmptyAtFirst_ZeroOutput() { //Arrange, Act int result = Recipe.GetAll().Count; //Assert Assert.Equal(0, result); }
public void Recipe_Delete_RemoveObjectFromDatabase() { Recipe testRecipe = new Recipe("Pot Pie", "Microwave it"); testRecipe.Save(); testRecipe.Delete(); Assert.Equal(0, Recipe.GetAll().Count); }
public void Recipe_Save_NoSaveOnDuplicateRecipe() { Recipe testRecipe = new Recipe("Pot Pie", "Microwave it"); testRecipe.Save(); Recipe secondRecipe = new Recipe("Pot Pie", "Microwave it"); secondRecipe.Save(); Assert.Equal(1, Recipe.GetAll().Count); }
public static Dictionary <string, object> ModelMaker() { Dictionary <string, object> model = new Dictionary <string, object> { { "recipes", Recipe.GetAll() }, { "categories", Category.GetAll() }, { "ingredients", Ingredient.GetAll() } }; return(model); }
public void Save_OneRecipe_RecipeSavedWithCorrectID() { //Arrange Recipe testRecipe = new Recipe("Pot Pie", "Microwave it"); testRecipe.Save(); Recipe savedRecipe = Recipe.GetAll()[0]; //Act int output = savedRecipe.GetId(); int verify = testRecipe.GetId(); //Assert Assert.Equal(verify, output); }
public void Save_OneRecipe_RecipeSavedToDatabase() { //Arrange Recipe testRecipe = new Recipe("Pot Pie", "Microwave it"); //Act testRecipe.Save(); List <Recipe> output = Recipe.GetAll(); List <Recipe> verify = new List <Recipe> { testRecipe }; //Assert Assert.Equal(verify, output); }
public void SaveGetAll_ManyRecipes_ReturnListOfRecipes() { //Arrange Recipe recipeOne = new Recipe("Pot Pie", "Microwave it"); recipeOne.Save(); Recipe recipeTwo = new Recipe("Instant Ramen", "Boil it"); recipeTwo.Save(); //Act List <Recipe> output = Recipe.GetAll(); List <Recipe> verify = new List <Recipe> { recipeOne, recipeTwo }; //Assert Assert.Equal(verify, output); }