Skip to content

Commit

Permalink
Remove implicit DateTimeOffset conversions
Browse files Browse the repository at this point in the history
Use `DateTimeOffset` not `DateTime` to remove implicit conversions.
  • Loading branch information
martincostello committed Oct 29, 2023
1 parent 568d828 commit 00cd051
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/Polly.Specs/Caching/AbsoluteTtlSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class AbsoluteTtlSpecs : IDisposable
[Fact]
public void Should_be_able_to_configure_for_near_future_time()
{
Action configure = () => new AbsoluteTtl(DateTime.Today.AddDays(1));
Action configure = () => new AbsoluteTtl(DateTimeOffset.UtcNow.Date.AddDays(1));

configure.Should().NotThrow();
}
Expand Down Expand Up @@ -38,8 +38,8 @@ public void Should_return_zero_ttl_if_configured_to_expire_in_past()
[Fact]
public void Should_return_timespan_reflecting_time_until_expiry()
{
DateTime today = DateTime.UtcNow.Date;
DateTime tomorrow = today.AddDays(1);
DateTimeOffset today = DateTimeOffset.UtcNow.Date;
DateTimeOffset tomorrow = today.AddDays(1);

AbsoluteTtl ttlStrategy = new AbsoluteTtl(tomorrow);

Expand Down

0 comments on commit 00cd051

Please sign in to comment.