CachelessSingleFileTests: the second cache's record is keyed by its name's hash, so assert the file's three records, not the key "c"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-23 12:21:38 +02:00
commit e06d5a2e8c

View file

@ -323,7 +323,9 @@ namespace GameCult.Caching.Tests
Assert.That(store.Attached, Is.SameAs(registry2), "the call's end did not detach the second cache's registry");
await cache2.AddAsync(new IdDeck { Name = "c" });
Assert.DoesNotThrow(() => cache2.FlushAllBackingStores());
Assert.That(new SingleFileMessagePackBackingStore(_path).ReadStoreSnapshot()!.Records.Select(record => record.Key), Is.SupersetOf(new[] { "a", "first", "c" }));
var keys = new SingleFileMessagePackBackingStore(_path).ReadStoreSnapshot()!.Records.Select(record => record.Key).ToArray();
Assert.That(keys, Has.Length.EqualTo(3), "the seed, the call's record and the cache's record");
Assert.That(keys, Does.Contain("a").And.Contain("first"));
}
// The attach waits for a call that is already inside the store, wherever in the call it is: here inside the payload encoding,