private DateTime TestCronNext(string cron, DateTime date, string expectedDate) { var sched = new CronSchedule(cron); var next = sched.TryGetNext(date); Assert.IsNotNull(next, "Expected next, CRON: '" + cron + "', date: " + date); var expected = DateTime.Parse(expectedDate); Assert.AreEqual(expected, next.Value, "Next date does not match expected."); return(next.Value); }