Пример #1
0
        public async Task <IActionResult> CreateMonthlyBackgroundTask([FromBody] CreateBackgroundTaskModel model,
                                                                      [FromRoute] int atDay    = 0, [FromRoute] int atHour = 0, [FromRoute] int atMinute = 0,
                                                                      [FromRoute] int atSecond = 0)
        {
            model.Expression = CronTemplates.Monthly(atDay, atHour, atMinute, atSecond);

            return(await CreateBackgroundTask(model));
        }
Пример #2
0
        public void Monthly_on_first_of_month()
        {
            var cron     = CronTemplates.Monthly();
            var schedule = CronTemplates.Parse(cron);
            var diff     = CompareTwoCronOccurrences(schedule);

            Assert.True(diff.Days == 30 || diff.Days == 31);
        }
Пример #3
0
        public void Monthly_on_first_of_month()
        {
            string          cron     = CronTemplates.Monthly();
            CrontabSchedule schedule = CrontabSchedule.Parse(cron);
            TimeSpan        diff     = CompareTwoCronOccurences(schedule);

            Assert.True(diff.Days == 30 || diff.Days == 31);
        }