Skip to content

Commit 4a66622

Browse files
committed
Add more tests
1 parent c6bee12 commit 4a66622

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

SqliteCache.Tests/BasicTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,27 @@ public void ExpirationStoredInUtc()
119119
Assert.IsNull(cache.Get("key"));
120120
}
121121
}
122+
123+
[TestMethod]
124+
public void DoubleDispose()
125+
{
126+
using (var cache = CreateDefault(true))
127+
{
128+
cache.Dispose();
129+
}
130+
}
131+
132+
#if NETCOREAPP3_0_OR_GREATER
133+
[TestMethod]
134+
public async Task AsyncDispose()
135+
{
136+
await using (var cache = CreateDefault(true))
137+
{
138+
await cache.SetAsync("foo", DefaultEncoding.GetBytes("hello"));
139+
var bytes = await cache.GetAsync("foo");
140+
CollectionAssert.AreEqual(bytes, DefaultEncoding.GetBytes("hello"));
141+
}
142+
}
143+
#endif
122144
}
123145
}

0 commit comments

Comments
 (0)