コード例 #1
0
        public void TestMultipleConfigurationsOfHours()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.HourRange(20, 30);
            bldr.HourIncrements(0, 20);
        }
コード例 #2
0
        public void TestMultipleConfigurationsOfYears()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.YearRange(2011, 2017);
            bldr.YearIncrements(2017, 3);
        }
コード例 #3
0
        public void TestMultipleConfigurationsOfSeconds()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.SecondRange(20, 30);
            bldr.SecondIncrements(0, 20);
        }
コード例 #4
0
        public void TestMultipleConfigurationsOfDays()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.DayOfWeekRange(DayOfWeek.Friday, DayOfWeek.Sunday);
            bldr.DayOfWeekIncrements(0, 20);
        }
コード例 #5
0
        public void TestMultipleConfigurationsOfMonths()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.MonthRange(1, 7);
            bldr.MonthIncrements(7, 3);
        }
コード例 #6
0
        public void TestMultipleConfigurationsOfMinutes()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.MinuteRange(20, 30);
            bldr.MinuteIncrements(0, 20);
        }
コード例 #7
0
        public void TestMultipleConfigurationsOfDaysOfMonth()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.DayOfMonthRange(20, 30);
            bldr.DayOfMonthIncrements(0, 20);
        }
コード例 #8
0
        public void TestIncrementsOfDaysOfWeek()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.DayOfWeekIncrements(DayOfWeek.Sunday, 2);

            Assert.AreEqual("* * * ? * 1/2", bldr.CronExpression);
        }
コード例 #9
0
        public void TestRangeOfSeconds()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.SecondRange(20, 30);

            Assert.AreEqual("20-30 * * ? * *", bldr.CronExpression);
        }
コード例 #10
0
        public void AddHourInterval_Above23()
        {
            var builder = new CronExpressionBuilder();
            var hours = 28;
            builder.HourInterval(hours);

            builder.CronExpression.ShouldEqual("* 4 * * *");
        }
コード例 #11
0
        public void AddMinuteInterval_Above60()
        {
            var builder = new CronExpressionBuilder();
            var minutes = 92;
            builder.MinuteInterval(minutes);

            builder.CronExpression.ShouldEqual("32 * * * *");
        }
コード例 #12
0
        public void TestNthDayOfWeekOfMonth()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.NthDayOfWeekOfMonth(DayOfWeek.Sunday, 3);

            Assert.AreEqual("* * * ? * 1#3", bldr.CronExpression );
        }
コード例 #13
0
        public void TestMultipleDayOfWeekEmptyList()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            List<DayOfWeek> desiredDays = new List<DayOfWeek>();

            bldr.DayOfWeek(desiredDays);
        }
コード例 #14
0
        public void TestNearestWeekDayOfMonth()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.NearestWeekDayOfMonth(15);

            Assert.AreEqual("* * * 15W * ?", bldr.CronExpression);
        }
コード例 #15
0
        public void TestSpecificMonth()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.Month(2);

            Assert.AreEqual("* * * ? 2 *", bldr.CronExpression);
        }
コード例 #16
0
        public void TestRangeOfMonths()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.MonthRange(2, 8);

            Assert.AreEqual("* * * ? 2-8 *", bldr.CronExpression);
        }
コード例 #17
0
        public void TestIncrementsOfMonths()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.MonthIncrements(3, 5);

            Assert.AreEqual("* * * ? 3/5 *", bldr.CronExpression);
        }
コード例 #18
0
        public void TestSpecificHour()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.Hour(10);

            Assert.AreEqual("* * 10 ? * *", bldr.CronExpression);
        }
コード例 #19
0
        public void TestRangeOfHours()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.HourRange(20, 22);

            Assert.AreEqual("* * 20-22 ? * *", bldr.CronExpression);
        }
コード例 #20
0
        public void TestMultipleDayOfMonthEmptyList()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            List<int> desiredDays = new List<int>();

            bldr.DayOfMonth(desiredDays);
        }
コード例 #21
0
        public void TestLastDayOfWeek()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.LastDayOfWeek();

            Assert.AreEqual("* * * ? * L", bldr.CronExpression);
        }
コード例 #22
0
        public void TestLastDayOfWeekInMonth()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.LastDayOfWeekInMonth(DayOfWeek.Thursday);

            Assert.AreEqual("* * * ? * 5L", bldr.CronExpression);
        }
コード例 #23
0
        public void TestIncrementsOfDaysOfMonth()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.DayOfMonthIncrements(1, 5);

            Assert.AreEqual("* * * 1/5 * ?", bldr.CronExpression);
        }
コード例 #24
0
        public void TestMultipleSecondEmptyList()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            List<int> desiredSeconds = new List<int>();

            bldr.Second(desiredSeconds);
        }
コード例 #25
0
        public void TestLastDayOfMonth()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.LastDayOfMonth();

            Assert.AreEqual("* * * L * ?", bldr.CronExpression);
        }
コード例 #26
0
        public void TestIncrementsOfSeconds()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.SecondIncrements(0, 10);

            Assert.AreEqual("0/10 * * ? * *", bldr.CronExpression);
        }
コード例 #27
0
        public void TestSpecificMinute()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.Minute(10);

            Assert.AreEqual("* 10 * ? * *", bldr.CronExpression);
        }
コード例 #28
0
        public void TestRangeOfMinutes()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.MinuteRange(20, 30);

            Assert.AreEqual("* 20-30 * ? * *", bldr.CronExpression);
        }
コード例 #29
0
        public void TestMultipleMinuteEmptyList()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            List<int> desiredMinutes = new List<int>();

            bldr.Minute(desiredMinutes);
        }
コード例 #30
0
        public void TestIncrementsOfMinutes()
        {
            CronExpressionBuilder bldr = new CronExpressionBuilder();

            bldr.MinuteIncrements(0, 10);

            Assert.AreEqual("* 0/10 * ? * *", bldr.CronExpression);
        }
コード例 #31
0
 public JobRecurringJob(IPrinter printer) : base(CronExpressionBuilder.MinuteInterval(1))
 {
     _printer = printer;
 }
コード例 #32
0
 public MinutesExpressionBuilder(CronExpressionBuilder cronExpressionBuilder)
 {
     this.field             = new MinutesField();
     this.expressionBuilder = new HoursExpressionBuilder(cronExpressionBuilder);
 }
コード例 #33
0
 public DayOfTheWeekExpressionBuilder(CronExpressionBuilder cronExpressionBuilder)
 {
     this.field             = new DayOfWeekField();
     this.expressionBuilder = new YearExpressionBuilder(cronExpressionBuilder);
 }
コード例 #34
0
 public HoursExpressionBuilder(CronExpressionBuilder cronExpressionBuilder)
 {
     this.field             = new HoursField();
     this.expressionBuilder = new DayOfTheMonthExpressionBuilder(cronExpressionBuilder);
 }
コード例 #35
0
 internal void GivenIHaveACronExpressionBuilder()
 {
     this.cronExpressionBuilder = new CronExpressionBuilder();
 }
コード例 #36
0
 public MonthExpressionBuilder(CronExpressionBuilder cronExpressionBuilder)
 {
     this.field             = new MonthField();
     this.expressionBuilder = new DayOfTheWeekExpressionBuilder(cronExpressionBuilder);
 }