コード例 #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);
 }
コード例 #2
0
        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 double GetRating(string recipeName)
 {
     SqlRecipeManager srm = new SqlRecipeManager();
     return srm.GetRating(recipeName);
 }