@Test public void testRateInPastAfterUpdateShouldBeDefaultRate() { double newRate = new Random().nextDouble(); hourlyRate.updateCurrentRate(newRate); assertEquals(DEFAULT_RATE, hourlyRate.rateAt(LocalDate.now().minusWeeks(3)), DELTA_VALUE); }
@Test public void testUpdateCurrentRateShouldUpdateRate() { double newRate = new Random().nextDouble(); hourlyRate.updateCurrentRate(newRate); assertEquals(newRate, hourlyRate.currentRate(), DELTA_VALUE); }
@Test public void testRateInFutureAfterUpdateShouldBeNewRate() { double newRate = new Random().nextDouble(); hourlyRate.updateCurrentRate(newRate); assertEquals(newRate, hourlyRate.rateAt(LocalDate.now().plusWeeks(3)), DELTA_VALUE); }
@Test public void testCurrentRateShouldReturnDefaultRate() { assertEquals(DEFAULT_RATE, hourlyRate.currentRate(), DELTA_VALUE); }