Exemplo n.º 1
0
 public void is_time_test()
 {
     var cron_schedule = new CronSchedule("0 0 12 10 *");
     Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("12:00:00 am 10/12/2008")));
     Assert.IsFalse(cron_schedule.isTime(DateTime.Parse("12:01:00 am 10/12/2008")));
 }
Exemplo n.º 2
0
        public void is_time_day_of_week_test()
        {
            var cron_schedule = new CronSchedule("* * * * 0");
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("10/12/2008")));
            Assert.IsFalse(cron_schedule.isTime(DateTime.Parse("10/13/2008")));

            cron_schedule = new CronSchedule("* * * * */2");
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("10/14/2008")));
        }
Exemplo n.º 3
0
        public void is_time_month_test()
        {
            var cron_schedule = new CronSchedule("* * * 1 *");
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("1/1/2008")));

            cron_schedule = new CronSchedule("* * * 12 *");
            Assert.IsFalse(cron_schedule.isTime(DateTime.Parse("1/1/2008")));

            cron_schedule = new CronSchedule("* * * */3 *");
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("3/1/2008")));
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("6/1/2008")));
        }
Exemplo n.º 4
0
 public void is_time_day_of_month_test()
 {
     var cron_schedule = new CronSchedule("* * 1 * *");
     Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("2010/08/01")));
 }
Exemplo n.º 5
0
        public void is_time_hour_test()
        {
            var cron_schedule = new CronSchedule("* 0 * * *");
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("12:00 am")));

            cron_schedule = new CronSchedule("* 0,12 * * *");
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("12:00 am")));
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("12:00 pm")));
        }
Exemplo n.º 6
0
        public void is_time_minute_test()
        {
            var cron_schedule = new CronSchedule("0 * * * *");
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("8:00 am")));
            Assert.IsFalse(cron_schedule.isTime(DateTime.Parse("8:01 am")));

            cron_schedule = new CronSchedule("0-10 * * * *");
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("8:00 am")));
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("8:03 am")));

            cron_schedule = new CronSchedule("*/2 * * * *");
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("8:00 am")));
            Assert.IsTrue(cron_schedule.isTime(DateTime.Parse("8:02 am")));
            Assert.IsFalse(cron_schedule.isTime(DateTime.Parse("8:03 am")));
        }