ElementIdEngineTests: the keyed self-enumerating node round-trips through MessagePack with its ids
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
fb2be32b60
commit
6e70626bf9
1 changed files with 4 additions and 0 deletions
|
|
@ -498,6 +498,10 @@ namespace GameCult.Caching.Tests
|
|||
Assert.That(Assign(root, "r", deterministic: true), Is.EqualTo(3));
|
||||
Assert.That(root.Nodes[0].Id, Has.Length.EqualTo(12));
|
||||
Assert.That(root.Nodes[0].Children[0].Children[0].Id, Has.Length.EqualTo(12));
|
||||
var options = GameCult.Caching.MessagePack.CultDocumentMessagePackSerialization.Options;
|
||||
var back = MessagePackSerializer.Deserialize<HKNode>(MessagePackSerializer.Serialize(root, options), options);
|
||||
Assert.That(back.Nodes[0].Id, Is.EqualTo(root.Nodes[0].Id), "MessagePack writes the node by key, ids included");
|
||||
Assert.That(back.Nodes[0].Children[0].Children[0].Id, Is.EqualTo(root.Nodes[0].Children[0].Children[0].Id));
|
||||
|
||||
// An unkeyed type that enumerates itself holds no element list and ends the type walk.
|
||||
var unkeyed = CultElementIds.Inspect(typeof(HUNode));
|
||||
|
|
|
|||
Loading…
Reference in a new issue