public void AddRecipe() { SqlRecipeManager srm = new SqlRecipeManager(); int before = srm.Count(); srm.AddRecipe("testUser", "RECIPE", "This is the steps to make RECIPE!"); int after = srm.Count(); Assert.AreEqual((before+1), after); }
public void AddInvalidRecipe() { SqlRecipeManager srm = new SqlRecipeManager(); int before = srm.Count(); srm.AddRecipe("", "" , "This is the steps to make RECIPIE!"); int after = srm.Count(); Assert.AreEqual(before, after); }
public void GetRecipe() { SqlRecipeManager srm = new SqlRecipeManager(); string expectedRecipe = "GETRECIPIE"; srm.AddRecipe("testUser", expectedRecipe, "This is the steps to make RECIPIE!"); Recipe found = srm.GetRecipe(expectedRecipe); Assert.AreEqual(expectedRecipe, found.Name); }
public void GetRecipeRating() { SqlRecipeManager srm = new SqlRecipeManager(); srm.AddRating(5, 1, 1); srm.AddRating(3, 1, 1); srm.AddRating(4, 1, 1); double expected = 4.0; double found = srm.GetRating("RECIPE"); Assert.AreEqual(expected, found); }
public void GetRecipeRating() { SqlRecipeManager srm = new SqlRecipeManager(); srm.AddRecipe("testUser", "RatingRecipe", "This is the steps to make RECIPIE!"); srm.AddRating(5, 1); srm.AddRating(5, 2); srm.AddRating(2, 3); double expected = 4; double found = srm.GetRating("RatingRecipe"); Assert.AreEqual(expected, found); }
public List<Recipe> GetTopRecipes() { SqlRecipeManager srm = new SqlRecipeManager(); return srm.GetTop5(); }
public List<Recipe> GetRecipesByRating(double rating, string recipeName) { SqlRecipeManager srm = new SqlRecipeManager(); return srm.GetRecipesByRating(rating, recipeName); }
public Common.Recipe GetRecipe(string name) { SqlRecipeManager srm = new SqlRecipeManager(); return srm.GetRecipe(name); }
public double GetRating(string recipeName) { SqlRecipeManager srm = new SqlRecipeManager(); return srm.GetRating(recipeName); }
public List<Common.Comment> GetComments(int recipeId) { SqlRecipeManager srm = new SqlRecipeManager(); return srm.GetComments(recipeId); }
public void AddRecipe(string username, string name, string content) { SqlRecipeManager srm = new SqlRecipeManager(); srm.AddRecipe(username, name, content); }
public void AddRating(int rating, int userId, int recipeId) { SqlRecipeManager srm = new SqlRecipeManager(); srm.AddRating(rating, userId, recipeId); }
public void AddComment(string username, int recipeId, string content) { SqlRecipeManager srm = new SqlRecipeManager(); srm.AddComment(username, recipeId, content); }