public void GetChargeablePassages_NoPassages_ReturnsNoPassages() { var tollFeeCalculator = new TollFeeCalculator(Substitute.For <IHolidayLookup>()); tollFeeCalculator.GetChargeablePassages(null).ShouldBeEmpty(); tollFeeCalculator.GetChargeablePassages(new DateTime[0]).ShouldBeEmpty(); }
public void GetChargeablePassages_OnlyOnePassage_ReturnsOnlyOnePassage() { var tollFeeCalculator = new TollFeeCalculator(Substitute.For <IHolidayLookup>()); tollFeeCalculator.GetChargeablePassages(new[] { new DateTime(2017, (int)Month.April, 5) }) .ShouldContain(new DateTime(2017, (int)Month.April, 5)); }
public void GetChargeablePassages_AllOccurWithinOneHour_ReturnsOnlyOnePassage() { var tollFeeCalculator = new TollFeeCalculator(Substitute.For <IHolidayLookup>()); var passages = tollFeeCalculator.GetChargeablePassages(new[] { new DateTime(2017, (int)Month.April, 5, 14, 05, 40), new DateTime(2017, (int)Month.April, 5, 14, 30, 40), new DateTime(2017, (int)Month.April, 5, 14, 59, 40), new DateTime(2017, (int)Month.April, 5, 15, 00, 40) }); passages.Count.ShouldBe(1); passages.ShouldContain(new DateTime(2017, (int)Month.April, 5, 14, 05, 40)); }