Exemple #1
0
 public void TestEvery3Day()
 {
     Assert.Equal("At 08:00 AM, every 3 days", GetDescription("0 0 8 1/3 * ? *"));
 }
Exemple #2
0
 public void TestWeekdaysAtTime()
 {
     Assert.Equal("At 11:30 AM, Monday through Friday", GetDescription("30 11 * * 1-5"));
 }
Exemple #3
0
 public void TestMinuteSpan()
 {
     Assert.Equal("Every minute between 11:00 AM and 11:10 AM", GetDescription("0-10 11 * * *"));
 }
Exemple #4
0
 public void TestMinuteRangeConbinedWithSecondRange()
 {
     Assert.Equal("Seconds 12 through 50 past the minute, minutes 0 through 10 past the hour, at 06:00 AM, only in 2022", GetDescription("12-50 0-10 6 * * * 2022"));
 }
Exemple #5
0
 public void TestEvery5Minutes()
 {
     Assert.Equal("Every 5 minutes", GetDescription("*/5 * * * *"));
     Assert.Equal("Every 10 minutes", GetDescription("0 0/10 * * * ?"));
 }
Exemple #6
0
 public void TestDayOfWeekInternalWithStepValue()
 {
     Assert.Equal("At 07:05 AM, every 3 days of the week, Tuesday through Saturday", GetDescription("0 5 7 ? * 2/3 *"));
 }
Exemple #7
0
 public void TestMinutesCombinedWithMultipleHourRanges()
 {
     Assert.Equal("At 1 minutes past the hour, at 01:00 AM and 03:00 AM through 04:59 AM", GetDescription("1 1,3-4 * * *"));
 }
Exemple #8
0
 public void TestMutiPartRangeMinutes()
 {
     Assert.Equal("At 2 and 4 through 5 minutes past the hour, at 01:00 AM", GetDescription("2,4-5 1 * * *"));
 }
Exemple #9
0
 public void TestMutiPartRangeMinutes2()
 {
     Assert.Equal("At 2 and 26 through 28 minutes past the hour, at 06:00 PM", GetDescription("2,26-28 18 * * *"));
 }
Exemple #10
0
 public void TestEvery3Month()
 {
     Assert.Equal("At 07:05 AM, on day 2 of the month, every 3 months", GetDescription("0 5 7 2 1/3 ? *"));
 }
Exemple #11
0
 public void TestEvery2Years()
 {
     Assert.Equal("At 06:15 AM, on day 1 of the month, only in January, every 2 years", GetDescription("0 15 6 1 1 ? 1/2"));
 }
Exemple #12
0
 public void TestEvery2DayOfTheWeekInRange()
 {
     // GitHub Issue #58: https://github.com/bradymholt/cron-expression-descriptor/issues/58
     Assert.Equal("Every second, every 2 days of the week, Monday through Friday", GetDescription("* * * ? * 1-5/2"));
 }
Exemple #13
0
 public void TestsEvery3DayOfTheWeek()
 {
     Assert.Equal("At 10:15 AM, every 3 days of the week", GetDescription("0 15 10 ? * */3"));
 }
Exemple #14
0
 public void TestTimeOfDayCertainDaysOfWeek()
 {
     Assert.Equal("At 11:00 PM, Monday through Friday", GetDescription("0 23 ? * MON-FRI"));
 }
Exemple #15
0
 public void TestDayOfMonthInternalWithStepValue()
 {
     Assert.Equal("At 07:05 AM, every 3 days, starting on day 2 of the month", GetDescription("0 5 7 2/3 * ? *"));
 }
Exemple #16
0
 public void TrailingSpaceDoesNotCauseAWrongDescription()
 {
     // GitHub Issue #51: https://github.com/bradymholt/cron-expression-descriptor/issues/51
     Assert.Equal("At 07:00 AM", GetDescription("0 7 * * * "));
 }
Exemple #17
0
 public void TestMonthInternalWithStepValue()
 {
     Assert.Equal("At 07:05 AM, every 2 months, March through December", GetDescription("0 5 7 ? 3/2 ? *"));
 }
Exemple #18
0
 public void TestEverySecond()
 {
     Assert.Equal("Every second", GetDescription("* * * * * *"));
 }
Exemple #19
0
 public void TestYearInternalWithStepValue()
 {
     Assert.Equal("At 07:05 AM, every 4 years, 2016 through 9999", GetDescription("0 5 7 ? * ? 2016/4"));
 }
Exemple #20
0
 public void TestMultiPartDayOfTheWeek()
 {
     // GitHub Issue #44: https://github.com/bradymholt/cron-expression-descriptor/issues/44
     Assert.Equal("At 10:00 AM, only on Monday through Thursday and Sunday", GetDescription("0 00 10 ? * MON-THU,SUN *"));
 }
Exemple #21
0
 public void TestEvery45Seconds()
 {
     Assert.Equal("Every 45 seconds", GetDescription("*/45 * * * * *"));
 }
Exemple #22
0
 public void TestDayOfWeekWithDayOfMonth()
 {
     // GitHub Issue #46: https://github.com/bradymholt/cron-expression-descriptor/issues/46
     Assert.Equal("At 12:00 AM, on day 1, 2, and 3 of the month, only on Wednesday and Friday", GetDescription("0 0 0 1,2,3 * WED,FRI"));
 }
Exemple #23
0
 public void TestSecondsExpressionCombinedWithHoursListAndSingleMinute()
 {
     Assert.Equal("At 5 seconds past the minute, at 30 minutes past the hour, at 06:00 AM, 02:00 PM, and 04:00 PM, on day 5 of the month", GetDescription("5 30 6,14,16 5 * *"));
 }
Exemple #24
0
 public void TestSecondsInternalWithStepValue()
 {
     // GitHub Issue #49: https://github.com/bradymholt/cron-expression-descriptor/issues/49
     Assert.Equal("Every 30 seconds, starting at 5 seconds past the minute", GetDescription("5/30 * * * * ?"));
 }
Exemple #25
0
 public void TestEvery5MinutesOnTheSecond()
 {
     Assert.Equal("Every 5 minutes", GetDescription("0 */5 * * * *"));
 }
Exemple #26
0
 public void TestMinutesInternalWithStepValue()
 {
     Assert.Equal("Every 30 minutes, starting at 5 minutes past the hour", GetDescription("0 5/30 * * * ?"));
 }
Exemple #27
0
 public void TestDailyAtTime()
 {
     Assert.Equal("At 11:30 AM", GetDescription("30 11 * * *"));
 }
Exemple #28
0
 public void TestHoursInternalWithStepValue()
 {
     Assert.Equal("Every second, every 8 hours, starting at 05:00 AM", GetDescription("* * 5/8 * * ?"));
 }
Exemple #29
0
 public void TestOneMonthOnly()
 {
     Assert.Equal("Every minute, only in March", GetDescription("* * * 3 *"));
 }
Exemple #30
0
 public void TestHourRangeWithTrailingZeroWithEveryPortion()
 {
     Assert.Equal("At 25 minutes past the hour, every 13 hours, between 07:00 AM and 08:59 PM", GetDescription("0 25 7-20/13 ? * *"));
 }