Esempio n. 1
0
        public void NotMatchDayInMonthlyFixdTimeJobScheduleFrequencyTest()
        {
            MonthlyJobScheduleFrequency monthlyFrequency = PrepareMonthlyJobSchedule(1, 5);

            DateTime now       = DateTime.Now;
            DateTime startTime = new DateTime(now.Year, now.Month, 1);

            DateTime timePoint = startTime.AddDays(10) + new TimeSpan(10, 10, 10);

            TimeScope scope = monthlyFrequency.GetTimeScope(startTime, timePoint, _TimeOffset);

            Assert.IsNull(scope);
        }
Esempio n. 2
0
        public void MonthlyFixdTimeJobScheduleFrequencyTest()
        {
            MonthlyJobScheduleFrequency monthlyFrequency = PrepareMonthlyJobSchedule(1, 5);

            DateTime now       = DateTime.Now;
            DateTime startTime = new DateTime(now.Year, now.Month, 1);

            DateTime timePoint = startTime.AddDays(4) + new TimeSpan(10, 10, 10);

            TimeScope scope = monthlyFrequency.GetTimeScope(startTime, timePoint, _TimeOffset);

            Assert.IsNotNull(scope);

            Console.WriteLine(scope.BeginTime);
            Console.WriteLine(scope.EndTime);

            Assert.AreEqual(new TimeSpan(10, 10, 10) - _TimeOffset, scope.BeginTime);
            Assert.AreEqual(new TimeSpan(10, 10, 10) + _TimeOffset, scope.EndTime);
        }