예제 #1
0
        public void ShouldReturnAllPostsWhenNoDateRangeIsEntered()
        {
            _postDataAccess = new Mock<IPostDataAccess>();
            _postDataAccess.Setup(x => x.GetPostsByDateRange(It.IsAny<DateTime>(), It.IsAny<DateTime>()))
                .Returns(Mother.PostsWithoutTagsOrComments);

            var sut = new PostBLL(_postDataAccess.Object);

            var posts = sut.GetPostsByDateRange(null, null);

            Assert.Equal(Mother.PostsWithoutTagsOrComments.Count(), posts.Count());
        }