RecentPosts() public method

public RecentPosts ( int pageNumber, int pageSize, int categoryId, System.DateTime startDate, System.DateTime endDate ) : IEnumerable
pageNumber int
pageSize int
categoryId int
startDate System.DateTime
endDate System.DateTime
return IEnumerable
        public void RecentPostsBeforeEndDate()
        {
            // Arrange
            PostViewModel mappedPost1 = new PostViewModel { PostID = 1 };
            PostsService service = new PostsService(_unitOfWorkFactory, _mapper);
            _mapper.Stub(x => x.Map(_post1)).Return(mappedPost1);

            // Act
            IEnumerable<PostViewModel> models = service.RecentPosts(0, 10, null, null, DateTime.Now.Subtract(TimeSpan.FromDays(1)));

            // Assert
            Assert.That(models.First(), Is.EqualTo(mappedPost1));
            Assert.That(models.Count(), Is.EqualTo(1));
        }
        public void RecentPostsInCategory()
        {
            // Arrange
            PostViewModel mappedPost1 = new PostViewModel { PostID = 1 };
            PostViewModel mappedPost2 = new PostViewModel { PostID = 2 };
            PostsService service = new PostsService(_unitOfWorkFactory, _mapper);
            _mapper.Stub(x => x.Map(_post1)).Return(mappedPost1);
            _mapper.Stub(x => x.Map(_post2)).Return(mappedPost2);

            // Act
            IEnumerable<PostViewModel> models = service.RecentPosts(0, 10, 1, null, null);

            // Assert
            Assert.That(models.First(), Is.EqualTo(mappedPost1));
            Assert.That(models.Count(), Is.EqualTo(1));
        }
        public void RecentPostsThrowsExceptionOnTooLargePageSize()
        {
            // Arrange
            PostsService service = new PostsService(_unitOfWorkFactory, _mapper);

            // Act
            service.RecentPosts(0, 220, null, null, null);
        }