Skip to content

Commit

Permalink
Add GetNextOccurrence_ReturnsAGreaterValue_EvenWhenMillisecondTruncat…
Browse files Browse the repository at this point in the history
…ionRuleIsAppliedDueToDST test
  • Loading branch information
odinserj committed May 26, 2021
1 parent a1a4c2d commit 08adc4b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Cronos.Tests/CronExpressionFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2312,6 +2312,17 @@ public void GetNextOccurrence_MakesProgressInsideLoop(string expression, string
}
}

[Fact]
public void GetNextOccurrence_ReturnsAGreaterValue_EvenWhenMillisecondTruncationRuleIsAppliedDueToDST()
{
var expression = CronExpression.Parse("* * * * * *", CronFormat.IncludeSeconds);
var fromInstant = DateTimeOffset.Parse("2021-03-25 23:59:59.9999999 +02:00");

var nextInstant = expression.GetNextOccurrence(fromInstant, JordanTimeZone, inclusive: true);

Assert.True(nextInstant > fromInstant);
}

[Theory]
[InlineData("* * * * *", "2017-03-16 16:00", "2017-03-16 16:01")]
[InlineData("5 * * * *", "2017-03-16 16:05", "2017-03-16 17:05")]
Expand Down

0 comments on commit 08adc4b

Please sign in to comment.