Test: the directory store's wrong-format refusal is the typed exception naming the manifest

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 08:22:58 +02:00
commit bcf6ce5cf6

View file

@ -213,7 +213,8 @@ namespace GameCult.Caching.Tests
using var cache = new CultCache();
Assert.That(() => cache.AddBackingStore(new DirectoryMessagePackBackingStore(manifest)),
Throws.TypeOf<InvalidOperationException>().With.Message.Contains(formatVersion));
Throws.TypeOf<CultStoreUnreadableException>().With.Message.Contains(formatVersion)
.And.Property(nameof(CultStoreUnreadableException.Path)).EqualTo(manifest));
Assert.That(cache.BackingStores, Is.Empty);
Assert.That(File.ReadAllBytes(manifest), Is.EqualTo(bytes));
}