Util.rollToNextWeekStart(builder, Weekday.MO);
assertEquals("20060206", builder.toDate().toString());
}
public void testNextWeekStart() throws Exception {
assertEquals(new DateValueImpl(2006, 1, 24),
Util.nextWeekStart(new DateValueImpl(2006, 1, 23),
Weekday.TU));
assertEquals(new DateValueImpl(2006, 1, 24),
Util.nextWeekStart(new DateValueImpl(2006, 1, 24),
Weekday.TU));
assertEquals(new DateValueImpl(2006, 1, 31),
Util.nextWeekStart(new DateValueImpl(2006, 1, 25),
Weekday.TU));
assertEquals(new DateValueImpl(2006, 1, 23),
Util.nextWeekStart(new DateValueImpl(2006, 1, 23),
Weekday.MO));
assertEquals(new DateValueImpl(2006, 1, 30),
Util.nextWeekStart(new DateValueImpl(2006, 1, 24),
Weekday.MO));
assertEquals(new DateValueImpl(2006, 1, 30),
Util.nextWeekStart(new DateValueImpl(2006, 1, 25),
Weekday.MO));
assertEquals(new DateValueImpl(2006, 2, 6),
Util.nextWeekStart(new DateValueImpl(2006, 1, 31),
Weekday.MO));
}