public void GetTollFee_Call_Before_Calling_EndConfiguration_Throws_InvalidOperationException() { var vehicle = new Mock <IVehicle>(); var rule = new DayRule() .AddTime(new TimeSpan(1, 0, 0), 0); Assert.Throws <InvalidOperationException>(() => rule.GetTollFee(vehicle.Object, new DateTime(2018, 12, 22))); }
public void GetTollFee_Time_Less_Then_First_Added_Time() { var expectedTollFee = 10; var vehicle = new Mock <IVehicle>(); var rule = new DayRule() .AddTime(new TimeSpan(1, 0, 0), 5) .AddTime(new TimeSpan(3, 0, 0), expectedTollFee) .EndConfiguration(); var tollFee = rule.GetTollFee(vehicle.Object, new DateTime(2018, 12, 22, 0, 30, 0)); Assert.Equal(expectedTollFee, tollFee); }