Пример #1
0
  @Test
  public void testRateInFutureAfterUpdateShouldBeNewRate() {
    double newRate = new Random().nextDouble();

    hourlyRate.updateCurrentRate(newRate);

    assertEquals(newRate, hourlyRate.rateAt(LocalDate.now().plusWeeks(3)), DELTA_VALUE);
  }
Пример #2
0
  @Test
  public void testRateInPastAfterUpdateShouldBeDefaultRate() {
    double newRate = new Random().nextDouble();

    hourlyRate.updateCurrentRate(newRate);

    assertEquals(DEFAULT_RATE, hourlyRate.rateAt(LocalDate.now().minusWeeks(3)), DELTA_VALUE);
  }
Пример #3
0
  @Test
  public void testUpdateCurrentRateShouldUpdateRate() {
    double newRate = new Random().nextDouble();

    hourlyRate.updateCurrentRate(newRate);

    assertEquals(newRate, hourlyRate.currentRate(), DELTA_VALUE);
  }