public void GetsTheNextDayIfNoBankHolidaysInDb() { DateTime dt = new DateTime(2020, 06, 17); _fakeGateway = new Mock <IINeedHelpGateway>(); _classUnderTest = new UtilityHelper(_fakeGateway.Object); _classUnderTest.GetNextWorkingDay(dt).Should().Be(dt.AddDays(1)); }
public void GetsTheFollowingTuesdayIfDayIsFridayAndNextMondayIsBankHoliday() { DateTime dt = new DateTime(2020, 06, 19); var bankHoliday = _fixture.Create <BankHoliday>(); bankHoliday.Date = dt.AddDays(3); _fakeGateway = new Mock <IINeedHelpGateway>(); _fakeGateway.Setup(x => x.GetNextBankHoliday(It.IsAny <DateTime>())).Returns(bankHoliday); _classUnderTest = new UtilityHelper(_fakeGateway.Object); _classUnderTest.GetNextWorkingDay(dt).Should().Be(dt.AddDays(4)); }
public void GetsTheNextDayIfNotABankHoliday() { DateTime dt = new DateTime(2020, 06, 17); var bankHoliday = _fixture.Create <BankHoliday>(); bankHoliday.Date = dt.AddDays(12); _fakeGateway = new Mock <IINeedHelpGateway>(); _fakeGateway.Setup(x => x.GetNextBankHoliday(dt)).Returns(bankHoliday); _classUnderTest = new UtilityHelper(_fakeGateway.Object); _classUnderTest.GetNextWorkingDay(dt).Should().Be(dt.AddDays(1)); }