public void NightRate_EntryIsOnSaturday() { parkingFeeCalculator = new NightRateCalulatorService(); DateTime entryTime = new DateTime(2020, 7, 11, 18, 5, 0); DateTime exitTime = new DateTime(2020, 7, 11, 23, 30, 0); var ruleApply = parkingFeeCalculator.IsRuleApplicable(entryTime, exitTime); Assert.IsFalse(ruleApply); }
public void NightRateTest_ExitTimeNotMeetingConditon() { parkingFeeCalculator = new NightRateCalulatorService(); DateTime entryTime = new DateTime(2020, 7, 10, 16, 5, 0); DateTime exitTime = new DateTime(2020, 7, 10, 23, 47, 0); var ruleApply = parkingFeeCalculator.IsRuleApplicable(entryTime, exitTime); Assert.IsFalse(ruleApply); }
public void EarlyBirdTest_ExitTimeNotMeetingCondition() { parkingFeeCalculator = new EarlyBirdRateCalculatorService(); DateTime entryTime = new DateTime(2020, 7, 12, 6, 0, 0); DateTime exitTime = new DateTime(2020, 7, 12, 23, 55, 0); var ruleApply = parkingFeeCalculator.IsRuleApplicable(entryTime, exitTime); Assert.IsFalse(ruleApply); }
public void NightRateTest() { parkingFeeCalculator = new NightRateCalulatorService(); DateTime entryTime = new DateTime(2020, 7, 10, 18, 5, 0); DateTime exitTime = new DateTime(2020, 7, 10, 23, 30, 0); var fee = parkingFeeCalculator.Calculate(entryTime, exitTime); var ruleApply = parkingFeeCalculator.IsRuleApplicable(entryTime, exitTime); Assert.AreEqual(6.5, fee); Assert.IsTrue(ruleApply); }
public void WeekendRateTest_EntrySatExitSun() { parkingFeeCalculator = new WeekendRateCalculatorService(); DateTime entryTime = new DateTime(2020, 7, 11, 0, 0, 0); DateTime exitTime = new DateTime(2020, 7, 12, 23, 30, 0); var fee = parkingFeeCalculator.Calculate(entryTime, exitTime); var ruleApply = parkingFeeCalculator.IsRuleApplicable(entryTime, exitTime); Assert.AreEqual(10, fee); Assert.IsTrue(ruleApply); }
public void EarlyBirdTest() { parkingFeeCalculator = new EarlyBirdRateCalculatorService(); DateTime entryTime = new DateTime(2020, 7, 12, 7, 0, 0); DateTime exitTime = new DateTime(2020, 7, 12, 23, 30, 0); var ruleApply = parkingFeeCalculator.IsRuleApplicable(entryTime, exitTime); var fee = parkingFeeCalculator.Calculate(entryTime, exitTime); Assert.AreEqual(13, fee); Assert.IsTrue(ruleApply); }