public void ThrowsExceptionIfCalendarCannotExist() { var calendar = new CifCalendar( new DateTime(2019, 8, 2), new DateTime(2019, 8, 1), DaysFlag.Everyday, BankHolidayRunning.RunsOnBankHoliday); Assert.Throws <ArgumentOutOfRangeException>(() => calendar.Generate()); }
public static ICalendar CreateEverydayCalendar(DateTime runsFrom, DateTime runsTo) { var calendar = new CifCalendar( runsFrom, runsTo, DaysFlag.Everyday, BankHolidayRunning.RunsOnBankHoliday); calendar.Generate(); return(calendar); }
public static ICalendar CreateAugust2019Calendar(DaysFlag dayMask = DaysFlag.Everyday, BankHolidayRunning bankHolidays = BankHolidayRunning.RunsOnBankHoliday) { var calendar = new CifCalendar( new DateTime(2019, 8, 1), new DateTime(2019, 8, 31), dayMask, bankHolidays); calendar.Generate(); return(calendar); }
public void HandlesSingleDayCalendars(DateTime day, bool expected) { var calendar = new CifCalendar( new DateTime(2019, 8, 1), new DateTime(2019, 8, 1), DaysFlag.Everyday, BankHolidayRunning.RunsOnBankHoliday); calendar.Generate(); Assert.Equal(expected, calendar.IsActiveOn(day)); }