コード例 #1
0
        public void GetArchivedMonths_CallGetDistinctPreviousMonths()
        {
            var sut = new Archiver(_fakeDistinctMonthHelper.Object, _fakeArchiveMapper.Object);

            sut.GetArchivedMonths(_dateTime, 5, Mother.GetFiveSimpleBlogPosts());

            _fakeDistinctMonthHelper.Verify(x => x.GetDistinctPreviousMonths(It.IsAny<DateTime>(), It.IsAny<int>()), Times.Once());
        }
コード例 #2
0
        public void GetArchivedMonths_CallMapArchiveViewModel()
        {
            _fakeDistinctMonthHelper.Setup(x => x.GetDistinctPreviousMonths(It.IsAny<DateTime>(), It.IsAny<int>()))
            .Returns(Mother.GetListOfFiveDateTimes());

            _fakeArchiveMapper.Setup(x => x.MapArchiveModel(Mother.GetListOfFiveDateTimes(), Mother.GetFiveSimpleBlogPosts()))
            .Returns(() => new List<Archive>());

            var sut = new Archiver(_fakeDistinctMonthHelper.Object, _fakeArchiveMapper.Object);

            sut.GetArchivedMonths(_dateTime, 5, Mother.GetFiveSimpleBlogPosts());

            _fakeArchiveMapper.Verify();
        }
コード例 #3
0
        public void GetArchivedMonths_ThrowAnArgumentNullException_IfBlogPostsParamIsNull()
        {
            var sut = new Archiver(_fakeDistinctMonthHelper.Object, _fakeArchiveMapper.Object);

            sut.GetArchivedMonths(_dateTime, 5, null);
        }