public void Find_WhenInfoCollectionIsEmpty_ReturnsNull() { IInfoCollection <ICreditInfo, Sut> sut = CreateSut(); IInfo <ICreditInfo> result = sut.Find(DateTime.Today); Assert.That(result, Is.Null); }
public void Find_WhenInfoCollectionContainsInfoElementForMatchingDate_ReturnsMatchingInfoElement() { 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.Find(infoOffset); Assert.That(result.Year == infoOffset.Year && result.Month == infoOffset.Month, Is.True); }