public void TaskServiceConvertorFactory_Weekly_Test()
        {
            var fact = new TaskServiceConvertorFactory();

            Trigger trig      = new WeeklyTrigger(DaysOfTheWeek.Monday);
            var     wrapped   = new Dev2Trigger(fact, trig);
            var     sanitised = fact.SanitiseTrigger(wrapped);

            AssertEqual(trig, sanitised);
            AssertTriggerValues <IWeeklyTrigger, WeeklyTrigger>(sanitised, trig,
                                                                ((a, b) => a.DaysOfWeek == b.DaysOfWeek));
        }
        public void TaskServiceConvertorFactory_SanitiseMonthly_Test()
        {
            var fact = new TaskServiceConvertorFactory();

            Trigger trig      = new MonthlyTrigger(2, MonthsOfTheYear.April);
            var     wrapped   = new Dev2Trigger(fact, trig);
            var     sanitised = fact.SanitiseTrigger(wrapped);

            AssertEqual(trig, sanitised);
            AssertTriggerValues <IMonthlyTrigger, MonthlyTrigger>(sanitised, trig,
                                                                  (a, b) => a.DaysOfMonth.FirstOrDefault() == b.DaysOfMonth.FirstOrDefault() && a.MonthsOfYear == b.MonthsOfYear);
        }
        public void TaskServiceConvertorFactory_Time_Test()
        {
            var fact = new TaskServiceConvertorFactory();

            Trigger trig      = new TimeTrigger(new DateTime(2005, 1, 1));
            var     wrapped   = new Dev2Trigger(fact, trig);
            var     sanitised = fact.SanitiseTrigger(wrapped);

            AssertEqual(trig, sanitised);
            AssertTriggerValues <ITimeTrigger, TimeTrigger>(sanitised, trig,
                                                            ((a, b) => a.StartBoundary == b.StartBoundary));
        }
        public void TaskServiceConvertorFactory_SanitiseMonthlyDOW_Test()
        {
            var fact = new TaskServiceConvertorFactory();

            Trigger trig      = new MonthlyDOWTrigger(DaysOfTheWeek.Monday, MonthsOfTheYear.April, WhichWeek.FourthWeek);
            var     wrapped   = new Dev2Trigger(fact, trig);
            var     sanitised = fact.SanitiseTrigger(wrapped);

            AssertEqual(trig, sanitised);
            AssertTriggerValues <IMonthlyDOWTrigger, MonthlyDOWTrigger>(sanitised, trig,
                                                                        (a, b) => a.DaysOfWeek == b.DaysOfWeek && a.MonthsOfYear == b.MonthsOfYear && a.RandomDelay == b.RandomDelay && a.WeeksOfMonth == b.WeeksOfMonth);
        }