public class CalendarSequenceFunctionTest {
@Test
public void addOneDay() {
Calendar baseCalendar = DateTimeUtils.toCalendar("2011-04-09", new SimpleDateFormat("yyyy-MM-dd"));
SequenceFunction sequenceFunction = new SequenceFunction(new CalendarSequence(baseCalendar, new CalendarInterval(1, Calendar.DAY_OF_MONTH)));
for (int i=0; i<3; i++) {
Calendar calendar = sequenceFunction.generateValue();
assertEquals("Calendars should be equal", baseCalendar, calendar);
baseCalendar.add(Calendar.DAY_OF_MONTH, 1);
}
}