Skip to content

Commit

Permalink
feat: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Memoyu committed Oct 12, 2023
1 parent 9ece7ff commit e99a353
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,21 @@ public void Evicted_Event_Should_Trigger_When_GetExpiredItems()
_provider.Get<string>(key1);
System.Threading.Thread.Sleep(500);
}

[Fact]
public async void Issues497_GetCountAsync_Check_Expires_Test()
{
for (int i = 0; i < 9; i++)
{
await _provider.SetAsync(Guid.NewGuid().ToString(), $"value-{i}", TimeSpan.FromSeconds(5));
}

Assert.Equal(9, await _provider.GetCountAsync());

await Task.Delay(5000);

Assert.Equal(0, await _provider.GetCountAsync());
}
}

public class MemoryCachingProviderWithFactoryTest : BaseCachingProviderWithFactoryTest
Expand Down

0 comments on commit e99a353

Please sign in to comment.