From 4f7d8821affe14b45dcf30dc127ebf6cb3fd6faa Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 29 Sep 2026 13:29:09 +0200 Subject: [PATCH] Pin the create-in-group node check against a value that fits another grouping Co-Authored-By: Claude Sonnet 5 --- .../CultInspectorModelTests.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/GameCult.Caching.Tests/CultInspectorModelTests.cs b/tests/GameCult.Caching.Tests/CultInspectorModelTests.cs index bf0c815a..cddcb626 100644 --- a/tests/GameCult.Caching.Tests/CultInspectorModelTests.cs +++ b/tests/GameCult.Caching.Tests/CultInspectorModelTests.cs @@ -329,7 +329,7 @@ namespace GameCult.Caching.Tests private static readonly CultDocumentRegistry GroupRegistry = CultDocumentRegistry.ForTypes(new[] { - typeof(GroupLeaf), typeof(GroupRedeclared), typeof(GroupOptOut), typeof(GroupMixed), typeof(GroupGlobal), typeof(GroupNoCtor), typeof(InspectOther) + typeof(GroupLeaf), typeof(GroupRedeclared), typeof(GroupOptOut), typeof(GroupMixed), typeof(GroupGlobal), typeof(GroupNoCtor), typeof(GroupTagged), typeof(InspectOther) }); private string _groupPath = string.Empty; @@ -580,7 +580,7 @@ namespace GameCult.Caching.Tests await cache.UpsertAsync(typeof(GroupRedeclared), new GroupRedeclared { Kind = "k" }, new CultRecordKey("g1")); var kindNode = model.GroupRecords(typeof(GroupRedeclared), cache.AllStoredDocuments).Single(); - Assert.That(() => model.CreateInGroup(typeof(GroupLeaf), kindNode, out _), Throws.ArgumentException, "same depth, other members"); + Assert.That(() => model.CreateInGroup(typeof(GroupTagged), kindNode, out _), Throws.ArgumentException, "a value that would fit another grouping's member"); } [Test] @@ -893,6 +893,15 @@ namespace GameCult.Caching.Tests public string Kind = string.Empty; } + [CultInspectorGroupBy("Tag")] + [CultDocument("tests.group_tagged", "tests.group_tagged.v1")] + [MessagePackObject] + public sealed class GroupTagged + { + [Key(0)] + public string Tag = string.Empty; + } + [CultInspectorGroupBy("Kind")] [CultDocument("tests.group_no_ctor", "tests.group_no_ctor.v1")] [MessagePackObject]