示例#1
0
  @Test
  public void testRateInPastAfterUpdateShouldBeDefaultRate() {
    double newRate = new Random().nextDouble();

    hourlyRate.updateCurrentRate(newRate);

    assertEquals(DEFAULT_RATE, hourlyRate.rateAt(LocalDate.now().minusWeeks(3)), DELTA_VALUE);
  }
示例#2
0
  @Test
  public void testUpdateCurrentRateShouldUpdateRate() {
    double newRate = new Random().nextDouble();

    hourlyRate.updateCurrentRate(newRate);

    assertEquals(newRate, hourlyRate.currentRate(), DELTA_VALUE);
  }
示例#3
0
  @Test
  public void testRateInFutureAfterUpdateShouldBeNewRate() {
    double newRate = new Random().nextDouble();

    hourlyRate.updateCurrentRate(newRate);

    assertEquals(newRate, hourlyRate.rateAt(LocalDate.now().plusWeeks(3)), DELTA_VALUE);
  }
示例#4
0
 @Test
 public void testCurrentRateShouldReturnDefaultRate() {
   assertEquals(DEFAULT_RATE, hourlyRate.currentRate(), DELTA_VALUE);
 }