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()); }
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(); }
public void GetArchivedMonths_ThrowAnArgumentNullException_IfBlogPostsParamIsNull() { var sut = new Archiver(_fakeDistinctMonthHelper.Object, _fakeArchiveMapper.Object); sut.GetArchivedMonths(_dateTime, 5, null); }