Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        public static ICalendar CreateEverydayCalendar(DateTime runsFrom, DateTime runsTo)
        {
            var calendar = new CifCalendar(
                runsFrom,
                runsTo,
                DaysFlag.Everyday,
                BankHolidayRunning.RunsOnBankHoliday);

            calendar.Generate();
            return(calendar);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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));
        }