diff --git a/tests/Imazen.HybridCache.Tests/HybridCacheSqliteTests.cs b/tests/Imazen.HybridCache.Tests/HybridCacheTests.cs similarity index 77% rename from tests/Imazen.HybridCache.Tests/HybridCacheSqliteTests.cs rename to tests/Imazen.HybridCache.Tests/HybridCacheTests.cs index 71ab1c9d..ac5ff3d5 100644 --- a/tests/Imazen.HybridCache.Tests/HybridCacheSqliteTests.cs +++ b/tests/Imazen.HybridCache.Tests/HybridCacheTests.cs @@ -38,7 +38,6 @@ Task>> DataProvider(CancellationToken token) } var result = await cache.GetOrCreateBytes(key, DataProvider, cancellationToken, true); - Assert.Equal("WriteSucceeded", result.Status); var result2 = await cache.GetOrCreateBytes(key, DataProvider, cancellationToken, true); @@ -53,7 +52,18 @@ Task>> DataProvider(CancellationToken token) Assert.Equal(contentType, result3.ContentType); Assert.NotNull(result3.Data); - + var key2 = new byte[] {2, 1, 2, 3}; + Task>> DataProvider2(CancellationToken token) + { + return Task.FromResult(new Tuple>(null, new ArraySegment(new byte[4000]))); + } + var result4 = await cache.GetOrCreateBytes(key2, DataProvider2, cancellationToken, true); + Assert.Equal("WriteSucceeded", result4.Status); + + var result5 = await cache.GetOrCreateBytes(key2, DataProvider, cancellationToken, true); + Assert.Equal("DiskHit", result5.Status); + Assert.Null(result5.ContentType); + Assert.NotNull(result5.Data); } finally {