PostsForCategory() 공개 메소드

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
리턴 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));
            }
        }