Ejemplo n.º 1
0
 public void ListAllBlogsInCategoryByCategoryIdDbTest()
 {
     var repo = new BlogPostRepo();
     var list = repo.ListAllBlogsInCategoryByCategoryId(2);
     var blogPost = list.FirstOrDefault(x => x.BlogPostID == 4);
     Assert.AreEqual(1,list.Count);
     Assert.AreEqual("ASP.NET MVC5", blogPost.PostTitle);
 }
Ejemplo n.º 2
0
        public void SaveBlogPostDBTest()
        {
            var repo = new BlogPostRepo();
            BlogPost blog = new BlogPost()
            {
               PostContent = "<p>Hello Everyone</p>",
               PostTitle = "Blog More",
               Status = new Status(){StatusID = 1},
               //UserID = "f319beb5-8a14-40c1-9cb5-0d6c92571ae4",
               DateOfPost = DateTime.Now

            };
            repo.SaveBlogPost(blog);
            var list = repo.GetAllBlogPosts();
            Assert.AreEqual(6,list.Count);
            Assert.AreEqual("Blog One", list.FirstOrDefault(x=>x.BlogPostID == 1).PostTitle);
        }
Ejemplo n.º 3
0
 public void GetAllBlogPostDBTest()
 {
     var repo = new BlogPostRepo();
     List<BlogPost> blogPost = repo.GetAllBlogPosts();
 }