Skip to content

Commit

Permalink
Add unit tests for null keys
Browse files Browse the repository at this point in the history
  • Loading branch information
wazzamatazz committed Aug 4, 2024
1 parent 7e1c7f1 commit 188df8c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/CacheTower.Tests/CacheStackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ public async Task Get_ThrowsOnUseAfterDisposal()

await cacheStack.GetAsync<int>("KeyDoesntMatter");
}
[DataTestMethod, ExpectedException(typeof(ArgumentNullException))]
[DataRow(true)]
[DataRow(false)]
public async Task Get_ThrowsOnNullKeyWithBackPopulation(bool enabled)
{
await using var cacheStack = new CacheStack(null, new(new[] { new MemoryCacheLayer() }));
await cacheStack.GetAsync<int>(null, enabled);
}
[TestMethod]
public async Task Get_BackPopulatesToEarlierCacheLayers()
{
Expand Down

0 comments on commit 188df8c

Please sign in to comment.