DailyScheduleCalculator extends Schedule { @Override public LocalDate[] getSchedule(final LocalDate startDate, final LocalDate endDate, final boolean fromEnd, final boolean generateRecursive) { return getSchedule(startDate, endDate); }  @Override LocalDate[] getSchedule(final LocalDate startDate, final LocalDate endDate, final boolean fromEnd, final boolean generateRecursive); LocalDate[] getSchedule(final LocalDate startDate, final LocalDate endDate); @Override ZonedDateTime[] getSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final boolean fromEnd, final boolean generateRecursive); ZonedDateTime[] getSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate);  }
@Test public void testSameStartAndEnd1() { final LocalDate date = LocalDate.of(2000, 1, 1); final LocalDate[] forward = CALCULATOR.getSchedule(date, date, false, true); assertEquals(forward.length, 1); assertEquals(forward[0], date); assertArrayEquals(CALCULATOR.getSchedule(date, date), forward); assertArrayEquals(CALCULATOR.getSchedule(date, date, true, true), forward); }
@Test public void testSameStartAndEnd2() { final ZonedDateTime date = DateUtils.getUTCDate(2000, 1, 1); final ZonedDateTime[] forward = CALCULATOR.getSchedule(date, date, false, true); assertEquals(forward.length, 1); assertEquals(forward[0], date); assertArrayEquals(CALCULATOR.getSchedule(date, date), forward); assertArrayEquals(CALCULATOR.getSchedule(date, date, true, true), forward); }
@Test public void test1() { final LocalDate startDate = LocalDate.of(2000, 1, 1); final LocalDate endDate = LocalDate.of(2002, 2, 9); final LocalDate[] forward = CALCULATOR.getSchedule(startDate, endDate); assertCalculator(startDate, endDate, forward); assertArrayEquals(CALCULATOR.getSchedule(startDate, endDate, false, true), forward); assertArrayEquals(CALCULATOR.getSchedule(startDate, endDate, true, true), forward); assertArrayEquals(CALCULATOR.getSchedule(startDate, endDate, false, false), forward); assertArrayEquals(CALCULATOR.getSchedule(startDate, endDate, true, false), forward); }
@Test public void test2() { final ZonedDateTime startDate = DateUtils.getUTCDate(2000, 1, 1); final ZonedDateTime endDate = DateUtils.getUTCDate(2002, 2, 9); final ZonedDateTime[] forward = CALCULATOR.getSchedule(startDate, endDate); assertCalculator(startDate, endDate, forward); assertArrayEquals(CALCULATOR.getSchedule(startDate, endDate, false, true), forward); assertArrayEquals(CALCULATOR.getSchedule(startDate, endDate, true, true), forward); assertArrayEquals(CALCULATOR.getSchedule(startDate, endDate, false, false), forward); assertArrayEquals(CALCULATOR.getSchedule(startDate, endDate, true, false), forward); }