public void TestTitleCasing() { ExpressionDescriptor ceh = new ExpressionDescriptor("* * * * *", new Options() { CasingType = CasingTypeEnum.Title }); Assert.AreEqual("Every Minute", ceh.GetDescription(DescriptionTypeEnum.FULL)); }
public void TestOnceAWeek() { ExpressionDescriptor ceh = new ExpressionDescriptor("46 9 * * 1"); Assert.AreEqual("At 09:46 AM, only on Mondays", ceh.FullDescription); }
public void TestOneMonthOnly() { ExpressionDescriptor ceh = new ExpressionDescriptor("* * * 3 *"); Assert.AreEqual("Every minute, daily, only in March", ceh.FullDescription); }
public void TestMonthName() { ExpressionDescriptor ceh = new ExpressionDescriptor("23 12 * JAN *"); Assert.AreEqual("At 12:23 PM, daily, only in January", ceh.FullDescription); }
public void TestMonthNameRange3() { ExpressionDescriptor ceh = new ExpressionDescriptor("23 12 * JAN-MAR *"); Assert.AreEqual("At 12:23 PM, daily, January-March", ceh.FullDescription); }
public void TestThreeTimesDaily() { ExpressionDescriptor ceh = new ExpressionDescriptor("30 6,14,16 * * *"); Assert.AreEqual("At 06:30 AM, 02:30 PM, and 04:30 PM, daily", ceh.FullDescription); }
public void TestMinuteSpan() { ExpressionDescriptor ceh = new ExpressionDescriptor("0-10 11 * * *"); Assert.AreEqual("Every minute between 11:00 AM and 11:10 AM, daily", ceh.FullDescription); }
public void TestDayOfWeekName() { ExpressionDescriptor ceh = new ExpressionDescriptor("23 12 * * SUN"); Assert.AreEqual("At 12:23 PM, only on Sundays", ceh.FullDescription); }
public void TestDayOfWeekRange() { ExpressionDescriptor ceh = new ExpressionDescriptor("*/5 15 * * MON-FRI"); Assert.AreEqual("Every 5 minutes, at 03:00 PM, Monday-Friday", ceh.FullDescription); }
public void TestDailyAtTime() { ExpressionDescriptor ceh = new ExpressionDescriptor("30 11 * * *"); Assert.AreEqual("At 11:30 AM, daily", ceh.FullDescription); }
public void TestDayOfMonth() { ExpressionDescriptor ceh = new ExpressionDescriptor("23 12 15 * *"); Assert.AreEqual("At 12:23 PM, on day 15 of the month", ceh.FullDescription); }
public void TestWeekdaysAtTime() { ExpressionDescriptor ceh = new ExpressionDescriptor("30 11 * * 1-5"); Assert.AreEqual("At 11:30 AM, Monday-Friday", ceh.FullDescription); }
public void TestTwoTimesEachAfternoon() { ExpressionDescriptor ceh = new ExpressionDescriptor("30 14,16 * * *"); Assert.AreEqual("At 02:30 PM and 04:30 PM, daily", ceh.FullDescription); }
public void TestTwoMonthsOnly() { ExpressionDescriptor ceh = new ExpressionDescriptor("* * * 3,6 *"); Assert.AreEqual("Every minute, daily, only in March and June", ceh.FullDescription); }
public void TestLowerCasing() { ExpressionDescriptor ceh = new ExpressionDescriptor("* * * * *", new Options() { CasingType = CasingTypeEnum.LowerCase }); Assert.AreEqual("every minute", ceh.GetDescription(DescriptionTypeEnum.FULL)); }
public void TestEveryMinute() { ExpressionDescriptor ceh = new ExpressionDescriptor("* * * * *"); Assert.AreEqual("Every minute, daily", ceh.FullDescription); }
/// <summary> /// Generates a human readable string for the Cron Expression /// </summary> /// <param name="expression">The cron expression string</param> /// <param name="options">Options to control the output description</param> /// <returns>The cron expression description</returns> public static string GetDescription(string expression, Options options) { ExpressionDescriptor descripter = new ExpressionDescriptor(expression, options); return descripter.GetDescription(DescriptionTypeEnum.FULL); }
/// <summary> /// Generates a human readable string for the Cron Expression /// </summary> /// <param name="expression">The cron expression string</param> /// <param name="options">Options to control the output description</param> /// <returns>The cron expression description</returns> public static string GetDescription(string expression, Options options) { ExpressionDescriptor descripter = new ExpressionDescriptor(expression, options); return(descripter.GetDescription(DescriptionTypeEnum.FULL)); }