예제 #1
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);
        }
예제 #3
0
 public void AddRating(int rating, int userId, int recipeId)
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     srm.AddRating(rating, userId, recipeId);
 }