//------------------------------------------------------------------------- public virtual void test_NO_HOLIDAYS() { HolidayCalendar test = HolidayCalendars.NO_HOLIDAYS; LocalDateUtils.stream(LocalDate.of(2011, 1, 1), LocalDate.of(2015, 1, 31)).forEach(date => { assertEquals(test.isBusinessDay(date), true); assertEquals(test.isHoliday(date), false); }); assertEquals(test.Name, "NoHolidays"); assertEquals(test.ToString(), "HolidayCalendar[NoHolidays]"); }
//------------------------------------------------------------------------- public virtual void test_FRI_SAT() { HolidayCalendar test = HolidayCalendars.FRI_SAT; LocalDateUtils.stream(LocalDate.of(2011, 1, 1), LocalDate.of(2015, 1, 31)).forEach(date => { bool isBusinessDay = date.DayOfWeek != FRIDAY && date.DayOfWeek != SATURDAY; assertEquals(test.isBusinessDay(date), isBusinessDay); assertEquals(test.isHoliday(date), !isBusinessDay); }); assertEquals(test.Name, "Fri/Sat"); assertEquals(test.ToString(), "HolidayCalendar[Fri/Sat]"); }
//------------------------------------------------------------------------- public virtual void test_THU_FRI() { HolidayCalendar test = HolidayCalendars.THU_FRI; LocalDateUtils.stream(LocalDate.of(2011, 1, 1), LocalDate.of(2015, 1, 31)).forEach(date => { bool isBusinessDay = date.DayOfWeek != THURSDAY && date.DayOfWeek != FRIDAY; assertEquals(test.isBusinessDay(date), isBusinessDay); assertEquals(test.isHoliday(date), !isBusinessDay); }); assertEquals(test.Name, "Thu/Fri"); assertEquals(test.ToString(), "HolidayCalendar[Thu/Fri]"); }
//------------------------------------------------------------------------- public virtual void test_SAT_SUN() { HolidayCalendar test = HolidayCalendars.SAT_SUN; LocalDateUtils.stream(LocalDate.of(2011, 1, 1), LocalDate.of(2015, 1, 31)).forEach(date => { bool isBusinessDay = date.DayOfWeek != SATURDAY && date.DayOfWeek != SUNDAY; assertEquals(test.isBusinessDay(date), isBusinessDay); assertEquals(test.isHoliday(date), !isBusinessDay); }); assertEquals(test.Name, "Sat/Sun"); assertEquals(test.ToString(), "HolidayCalendar[Sat/Sun]"); }