public void First_WhenInfoCollectionIsEmpty_ReturnsNull()
        {
            IInfoCollection <ICreditInfo, Sut> sut = CreateSut();

            IInfo <ICreditInfo> result = sut.First();

            Assert.That(result, Is.Null);
        }
        public void First_WhenInfoCollectionContainsOneInfoElement_ReturnsOldestInfoElement()
        {
            IInfoCollection <ICreditInfo, Sut> sut = CreateSut();

            DateTime infoOffset = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);

            sut.Add(_fixture.BuildCreditInfoMock(infoOffset).Object);

            IInfo <ICreditInfo> result = sut.First();

            Assert.That(result.Year == infoOffset.Year && result.Month == infoOffset.Month, Is.True);
        }
Пример #3
0
        public void Prev_WhenInfoCollectionDoesNotContainPreviousInfoElement_ReturnsNull()
        {
            IInfoCollection <ICreditInfo, Sut> sut = CreateSut();

            DateTime infoOffset = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);

            sut.Add(_fixture.BuildCreditInfoMock(infoOffset).Object);
            sut.Add(_fixture.BuildCreditInfoMock(infoOffset.AddMonths(-1)).Object);
            sut.Add(_fixture.BuildCreditInfoMock(infoOffset.AddMonths(-2)).Object);

            IInfo <ICreditInfo> result = sut.Prev(sut.First());

            Assert.That(result, Is.Null);
        }