}
}
@Test
public void testMissingDataWeekly() {
LocalDateDoubleTimeSeries result = F.getSampledTimeSeries(TS_ONE_MISSING_DAY, FRIDAY_SCHEDULE);
assertEquals(FRIDAY_SCHEDULE.length, result.size());
int i = 0, j = 1;
for (final Entry<LocalDate, Double> entry : result) {
assertEquals(FRIDAY_SCHEDULE[i++], entry.getKey());
if (entry.getKey().equals(MISSING_DAY_FRIDAY)) {
assertEquals(j - 1, entry.getValue(), 0);
} else {
assertEquals(j, entry.getValue(), 0);
}
j += 5;
}
result = F.getSampledTimeSeries(TS_THREE_MISSING_DAYS, MONDAY_SCHEDULE);
assertEquals(MONDAY_SCHEDULE.length, result.size());
i = 0;
j = 2;
for (final Entry<LocalDate, Double> entry : result) {
assertEquals(MONDAY_SCHEDULE[i++], entry.getKey());
if (entry.getKey().equals(MISSING_DAY_MONDAY_1)) {