From 02145a105cbf509afffdb6f8f45c73e7efb14048 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 10 Oct 2026 06:43:22 +0200 Subject: [PATCH] VerseGrammarTests: fixed record keys go through a batch (previous commit did not build) Co-Authored-By: Claude Opus 5.5 --- .../VerseGrammarTests.cs | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/VerseGrammarTests.cs b/tests/Aetheria.Shared.Tests/VerseGrammarTests.cs index f8e7758c0..642f66e27 100644 --- a/tests/Aetheria.Shared.Tests/VerseGrammarTests.cs +++ b/tests/Aetheria.Shared.Tests/VerseGrammarTests.cs @@ -244,21 +244,24 @@ public sealed class VerseGrammarTests : IDisposable { if (File.Exists(path)) File.Delete(path); using var cache = OpenScoped(path, false); - cache.Upsert(new VerseGrammar { Revision = 1, Description = "Fixture grammar." }); - cache.Upsert(typeof(VerseVerb), new VerseVerb { Name = "haul", RenderPath = VerseRenderPath.ShipAction, Description = "Carry cargo to a place.", - Roles = new[] { new VerseRole { Name = "cargo", Binds = VerseReferentKind.Cargo }, new VerseRole { Name = "destination", Binds = VerseReferentKind.Place } } }, new CultRecordKey("verb-haul")); - cache.Upsert(typeof(VerseVerb), new VerseVerb { Name = "attack", RenderPath = VerseRenderPath.ShipAction, Description = "Attack a faction.", - Roles = new[] { new VerseRole { Name = "target", Binds = VerseReferentKind.Faction } } }, new CultRecordKey("verb-attack")); - cache.Upsert(typeof(VerseVerb), new VerseVerb { Name = "speak", RenderPath = VerseRenderPath.Conversation, Description = "Say a thing.", Roles = new VerseRole[0] }, - new CultRecordKey("verb-speak")); var firstKey = new CultRecordKey("faction-adrasteia"); var secondKey = new CultRecordKey("faction-brannoch"); var first = new Faction { Name = "Adrasteia", ShortName = "ADR", Description = "First.", PrimaryColor = new float3(1, .5f, .25f) }; var second = new Faction { Name = "Brannoch", ShortName = "BRN", Description = "Second.", PrimaryColor = new float3(.25f, .5f, 1) }; first.Allegiance[new CultRecordRef(secondKey)] = .75f; second.Allegiance[new CultRecordRef(firstKey)] = .25f; - cache.Upsert(typeof(Faction), first, firstKey); - cache.Upsert(typeof(Faction), second, secondKey); + cache.Commit(batch => + { + batch.Upsert(typeof(VerseGrammar), new VerseGrammar { Revision = 1, Description = "Fixture grammar." }); + batch.Upsert(typeof(VerseVerb), new VerseVerb { Name = "haul", RenderPath = VerseRenderPath.ShipAction, Description = "Carry cargo to a place.", + Roles = new[] { new VerseRole { Name = "cargo", Binds = VerseReferentKind.Cargo }, new VerseRole { Name = "destination", Binds = VerseReferentKind.Place } } }, new CultRecordKey("verb-haul")); + batch.Upsert(typeof(VerseVerb), new VerseVerb { Name = "attack", RenderPath = VerseRenderPath.ShipAction, Description = "Attack a faction.", + Roles = new[] { new VerseRole { Name = "target", Binds = VerseReferentKind.Faction } } }, new CultRecordKey("verb-attack")); + batch.Upsert(typeof(VerseVerb), new VerseVerb { Name = "speak", RenderPath = VerseRenderPath.Conversation, Description = "Say a thing.", Roles = new VerseRole[0] }, + new CultRecordKey("verb-speak")); + batch.Upsert(typeof(Faction), first, firstKey); + batch.Upsert(typeof(Faction), second, secondKey); + }); cache.FlushAsync().Wait(); }