PostsForCategory() public method

Return collection of posts belongs to a particular category.
public PostsForCategory ( string categorySlug, int pageNo, int pageSize ) : IList
categorySlug string Category's url slug
pageNo int Page index
pageSize int Page size
return IList
示例#1
0
        public void PostForCategory_for_programming_returns_zero()
        {
            var testRepo = new BlogRepository(MockContext);
            IList<Post> result = testRepo.PostsForCategory("programming", 0, 5);

            Assert.That(result.Count, Is.EqualTo(0));
        }
示例#2
0
        public void PostForCategory_for_humor_returns_three_posts()
        {
            string testSlug = "humor";
            {
                var testRepo = new BlogRepository(MockContext);
                IList<Post> result = testRepo.PostsForCategory("humor", 0, 5);

                Assert.That(result.Count, Is.EqualTo(3));
            }
        }