misc tests update

This commit is contained in:
13xforever
2025-10-07 20:02:43 +05:00
parent 552d715642
commit d2f8fa219e

View File

@@ -17,16 +17,15 @@ public class MemoryCacheExtensionTests
const string testVal = "vale13";
cache.Set(13, testVal);
cache.Set("bob", 69);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(cache.TryGetValue(13, out string? expectedVal), Is.True);
Assert.That(expectedVal, Is.EqualTo(testVal));
Assert.That(cache.TryGetValue("bob", out int? expectedValInt), Is.True);
Assert.That(expectedValInt, Is.EqualTo(69));
}
);
Assert.That(cache.GetCacheKeys<int>(), Has.Count.EqualTo(1));
}
}
[Test]
public void GetCacheEntriesTest()
@@ -36,7 +35,10 @@ public class MemoryCacheExtensionTests
cache.Set(13, "val13");
cache.Set("bob", 69);
using (Assert.EnterMultipleScope())
{
Assert.That(cache.GetCacheEntries<int>(), Has.Count.EqualTo(1));
Assert.That(cache.GetCacheEntries<string>(), Has.Count.EqualTo(1));
}
}
}