From 0fa836cb46f532ea38ad477d83b60061480cde4e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 25 Oct 2026 20:27:59 +0100 Subject: [PATCH] Caching tests: attaching no store is refused (the argument check had no test) Found by the scoped mutation run over AddBackingStore. Builds. Co-Authored-By: Claude Sonnet 5.5 --- tests/GameCult.Caching.Tests/CachelessSingleFileTests.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/GameCult.Caching.Tests/CachelessSingleFileTests.cs b/tests/GameCult.Caching.Tests/CachelessSingleFileTests.cs index a3c5af78..782cc224 100644 --- a/tests/GameCult.Caching.Tests/CachelessSingleFileTests.cs +++ b/tests/GameCult.Caching.Tests/CachelessSingleFileTests.cs @@ -1170,6 +1170,14 @@ namespace GameCult.Caching.Tests Assert.That(store.Attached, Is.Null, "the registry was taken back"); } + [Test] + public void AttachingNoStoreIsRefusedBeforeAnythingIsHeld() + { + using var cache = new CultCache(CultDocumentRegistry.ForTypes(new[] { typeof(IdDeck) })); + + Assert.Throws(() => cache.AddBackingStore(null!)); + } + private const string ReentryRefusal = "A cacheless write was made inside a call that already holds this store"; // Until the attach publishes the cache the store's hold is the attach's, so a journal the pull's Admit runs on the attaching