Skip to content

Commit bfd18d0

Browse files
authored
Fix test expectation for .NET Fwk (#497)
1 parent 5f0a8b8 commit bfd18d0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

BitFaster.Caching.UnitTests/Lru/AfterAccessPolicyTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ public async Task UpdateUpdatesTickCount()
113113
public void WhenItemIsExpiredShouldDiscardIsTrue()
114114
{
115115
var item = this.policy.CreateItem(1, 2);
116+
117+
#if NETFRAMEWORK
118+
item.TickCount = Stopwatch.GetTimestamp() - StopwatchTickConverter.ToTicks(TimeSpan.FromSeconds(11));
119+
#else
116120
item.TickCount = Environment.TickCount - (int)TimeSpan.FromSeconds(11).ToEnvTick64();
121+
#endif
117122

118123
this.policy.ShouldDiscard(item).Should().BeTrue();
119124
}

BitFaster.Caching/IDiscreteTimePolicy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace BitFaster.Caching
88
public interface IDiscreteTimePolicy
99
{
1010
/// <summary>
11-
/// Gets the time to live for an item in the cache.
11+
/// Gets the time to expire for an item in the cache.
1212
/// </summary>
1313
/// <param name="key">The key of the item.</param>
1414
/// <param name="timeToExpire">If the key exists, the time to live for the item with the specified key.</param>

0 commit comments

Comments
 (0)