@Test
public void testBuild() throws Exception {

    LocalDate today = LocalDate.parse("2014-08-01");
    LocalDate min = LocalDate.parse("2014-07-29");
    LocalDate max = LocalDate.parse("2014-08-02");
    Week week = new Week(today, today, min, max);
    week.build();
    List<Day> days = week.getDays();
    assertEquals(7, days.size());
    LocalDate first = LocalDate.parse("2014-07-28");
    for (int i = 0; i < days.size(); i++) {
        Day day = days.get(i);
        assertEquals(first.plusDays(i), day.getDate());
        if (i == 4) {
            assertTrue(day.isToday());
        } else {
            assertFalse(day.isToday());
        }
        if (i > 0 && i < 6) {
            assertTrue(day.isEnabled());
        } else {
            assertFalse(day.isEnabled());
        }
    }
}