Пример #1
0
 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);
        }
Пример #4
0
 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);
        }
Пример #6
0
 public List<Recipe> GetTopRecipes()
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     return srm.GetTop5();
 }
Пример #7
0
 public List<Recipe> GetRecipesByRating(double rating, string recipeName)
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     return srm.GetRecipesByRating(rating, recipeName);
 }
Пример #8
0
 public Common.Recipe GetRecipe(string name)
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     return srm.GetRecipe(name);
 }
Пример #9
0
 public double GetRating(string recipeName)
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     return srm.GetRating(recipeName);
 }
Пример #10
0
 public List<Common.Comment> GetComments(int recipeId)
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     return srm.GetComments(recipeId);
 }
Пример #11
0
 public void AddRecipe(string username, string name, string content)
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     srm.AddRecipe(username, name, content);
 }
Пример #12
0
 public void AddRating(int rating, int userId, int recipeId)
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     srm.AddRating(rating, userId, recipeId);
 }
Пример #13
0
 public void AddComment(string username, int recipeId, string content)
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     srm.AddComment(username, recipeId, content);
 }