public void ExpirationWithAllWildCardsWillExpireAfterOneMinute() { ExtendedFormat oneMinuteExpiration = new ExtendedFormat("* * * * *"); DateTime baseTime = DateTime.Parse("5/1/2004 12:00:00"); DateTime expirationTime = DateTime.Parse("5/1/2004 12:01:00"); Assert.IsTrue(oneMinuteExpiration.IsExpired(baseTime, expirationTime)); }
public void TestForBug352() { ExtendedFormat format = new ExtendedFormat("0 0 1 4 *"); bool expired = format.IsExpired(new DateTime(2001, 4, 01, 00, 05, 0), new DateTime(2002, 3, 31, 23, 59, 0)); Assert.IsFalse(expired, "Has not hit midnight, April 1st of next year yet"); }
public void TestForBug353() { ExtendedFormat format = new ExtendedFormat("* * 29 * *"); bool expired = format.IsExpired(new DateTime(2003, 2, 10, 10, 10, 0), new DateTime(2003, 3, 10, 10, 10, 0)); Assert.IsTrue(expired, "Should have expired at end of month, even though there is no Feb. 29th"); }
public void IsExpiredTest() { ExtendedFormat format = new ExtendedFormat("1 * * * *"); bool expired = format.IsExpired(DateTime.Now.Subtract(new TimeSpan(1, 1, 2)), DateTime.Now); Assert.IsTrue(expired); }
public void SecondsAreRoundedOutBeforePerformingPerMinuteExpirations() { ExtendedFormat oneMinuteExpiration = new ExtendedFormat("* * * * *"); DateTime baseTime = DateTime.Parse("5/1/2004 12:00:59"); DateTime expirationTime = DateTime.Parse("5/1/2004 12:01:01"); Assert.IsTrue(oneMinuteExpiration.IsExpired(baseTime, expirationTime)); }