示例#1
0
  @Test
  public void calculateNextAppointmentDueDate() {
    mockCurrentDate(dayBeforeYesterday);
    assertEquals(yesterday.toLocalDate(), clinicVisits.nextAppointmentDueDate());

    mockCurrentDate(yesterday);
    assertEquals(yesterday.toLocalDate(), clinicVisits.nextAppointmentDueDate());

    mockCurrentDate(today);
    assertEquals(today.toLocalDate(), clinicVisits.nextAppointmentDueDate());

    mockCurrentDate(tomorrow);
    assertEquals(dayAfterTomorrow.toLocalDate(), clinicVisits.nextAppointmentDueDate());

    mockCurrentDate(dayAfterTomorrow);
    assertEquals(dayAfterTomorrow.toLocalDate(), clinicVisits.nextAppointmentDueDate());
  }
示例#2
0
 @Test
 public void calculateNextAppointmentDueDate_WhenNoVisitsExists() {
   clinicVisits.clear();
   assertNull(clinicVisits.nextAppointmentDueDate());
 }