Caching tests: the wrong-catalog refusal is raised while the store is added, so both steps sit inside the asserted call

Previous commit 122894f5 failed these four cases (AddBackingStore threw outside Assert.CatchAsync).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-12 02:06:26 +02:00
commit 4282d507cf

View file

@ -76,8 +76,12 @@ namespace GameCult.Caching.Tests
try
{
var cache = new CultCache();
cache.AddBackingStore(new SingleFileMessagePackBackingStore(Store($"wrong-slot-{slot}.cc", scratch)));
var error = Assert.CatchAsync<Exception>(async () => await cache.PullAllBackingStoresAsync());
var path = Store($"wrong-slot-{slot}.cc", scratch);
var error = Assert.CatchAsync<Exception>(async () =>
{
cache.AddBackingStore(new SingleFileMessagePackBackingStore(path));
await cache.PullAllBackingStoresAsync();
});
Assert.That(error!.Message, Does.Contain($"slot {slot} changed type"));
}
finally