Extension of CronExpression
Inheritance: Quartz.CronExpression
        public string GetExpressionSummary(string cronExpression)
        {
            Logger.Debug("Entered CronExpressionController.GetExpressionSummary()");

            var cronExpressionEx = new CronExpressionEx(cronExpression);

            return cronExpressionEx.GetExpressionSummary();
        }
        public void ShouldGetArrayOfFutureFireDateTimesForCronString()
        {
            // Arrange
            var csu = new CronExpressionEx("0 0 12 ? * MON-FRI *", _mockScheduler.Object);
            var dateTimeAfter = new DateTime(2016, 1, 1, 12, 0, 0);

            // Act 
            var result = csu.GetFutureFireDateTimesUtcAfter(dateTimeAfter, 10);

            // Assert
            Assert.Equal(10, result.Count);
            Assert.Equal(new DateTime(2016, 1, 4, 0, 0, 0), result[0].Date);
            Assert.Equal(new DateTime(2016, 1, 15, 0, 0, 0), result[9].Date);
        }
        public List<DateTime> GetFutureDateTimes(string cronExpression, string dateTimeAfter = null, int count = 100, string calendarName = null)
        {
            Logger.Debug("Entered CronExpressionController.GetFutureDateTimes()");

            DateTime dta = DateTime.UtcNow;

            if (!string.IsNullOrEmpty(dateTimeAfter))
            {
                dta = DateTime.Parse(dateTimeAfter);
            }

            var cronExpressionEx = new CronExpressionEx(cronExpression);

            return cronExpressionEx.GetFutureFireDateTimesUtcAfter(dta, count, calendarName);
        }
        public void ShouldGetArrayOfFutureFireDateTimesForCronStringExcludingCalendarDates()
        {
            // Arrange
            const string calName = "TestCal1";
            var cal = new HolidayCalendar();
            cal.AddExcludedDate(new DateTime(2016, 1, 4, 12, 0, 0));

            _mockScheduler.Setup(i => i.GetCalendar(calName)).Returns(cal);

            var csu = new CronExpressionEx("0 0 12 ? * MON-FRI *", _mockScheduler.Object);
            var dateTimeAfter = new DateTime(2016, 1, 1, 12, 0, 0);

            // Act 
            var result = csu.GetFutureFireDateTimesUtcAfter(dateTimeAfter, 10, calName);

            // Assert
            Assert.Equal(10, result.Count);
            Assert.Equal(new DateTime(2016, 1, 5, 0, 0, 0), result[0].Date);
            Assert.Equal(new DateTime(2016, 1, 18, 0, 0, 0), result[9].Date);
        }