コード例 #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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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);
 }
コード例 #5
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);
        }
コード例 #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);
 }