@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()); }
@Test public void calculateNextAppointmentDueDate_WhenNoVisitsExists() { clinicVisits.clear(); assertNull(clinicVisits.nextAppointmentDueDate()); }