public void Factory_ReturnsCorrectlyInitializedInstant() { var instant = ScheduleInstant.Factory(CrontabSchedule.Parse("* * * * *"), _timeZone); Assert.True(DateTime.UtcNow.AddMinutes(-2) < instant.NowInstant); Assert.True(instant.NowInstant < DateTime.UtcNow.AddMinutes(2)); }
public void GetMatches_ReturnsEmptyCollection_WhenGivenIntervalDoesNotSatisfyTheSchedule() { var time = new DateTime(2012, 12, 12, 00, 01, 00, DateTimeKind.Utc); var instant = new ScheduleInstant(time, CrontabSchedule.Parse("0 * * * *")); var matches = instant.GetMatches(time.AddMinutes(50)); Assert.Empty(matches); }