From 4b3c76e41884df9ed5c8c309c90123378d676649 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 30 Sep 2026 02:11:40 +0200 Subject: [PATCH] Caching tests: the open verdict is asserted where the store is attached AddBackingStore pulls, so a file the reader refuses throws on attach, outside the assertion. Wrap attach and pull together. Co-Authored-By: Claude Sonnet 5.5 --- tests/GameCult.Caching.Tests/StoreReadabilityTests.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs b/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs index 9f2cc074..2d9f32d1 100644 --- a/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs +++ b/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs @@ -66,11 +66,16 @@ namespace GameCult.Caching.Tests File.WriteAllBytes(path, File.ReadAllBytes(Path.Combine(VectorRoot(), vector))); using var cache = new CultCache(); - cache.AddBackingStore(new SingleFileMessagePackBackingStore(path)); + void Open() + { + cache.AddBackingStore(new SingleFileMessagePackBackingStore(path)); + cache.PullAllBackingStoresAsync().GetAwaiter().GetResult(); + } + if (reads) - Assert.DoesNotThrow(() => cache.PullAllBackingStoresAsync().GetAwaiter().GetResult()); + Assert.DoesNotThrow(Open); else - Assert.That(() => cache.PullAllBackingStoresAsync().GetAwaiter().GetResult(), Throws.Exception); + Assert.That(Open, Throws.Exception); } [TestCaseSource(nameof(Vectors))]