CultNet tests: read the written keys without a lambda over a ref struct
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 24m13s
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 24m13s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3687edee28
commit
34b0fa4c60
1 changed files with 4 additions and 4 deletions
|
|
@ -261,12 +261,12 @@ namespace GameCult.Networking.Tests
|
|||
var bytes = MessagePackSerializer.Serialize(type, instance, CultNetSchemaMessageSerialization.Options);
|
||||
|
||||
var reader = new MessagePackReader(bytes);
|
||||
var written = Enumerable.Range(0, reader.ReadMapHeader()).Select(_ =>
|
||||
var written = new System.Collections.Generic.List<string>();
|
||||
for (var entries = reader.ReadMapHeader(); entries > 0; entries--)
|
||||
{
|
||||
var key = reader.ReadString()!;
|
||||
written.Add(reader.ReadString()!);
|
||||
reader.Skip();
|
||||
return key;
|
||||
}).ToArray();
|
||||
}
|
||||
var declared = KeyedProperties(type).Select(p => p.GetCustomAttribute<KeyAttribute>()!.StringKey!).ToArray();
|
||||
Assert.That(written, Is.EquivalentTo(declared), $"{type.Name}: its formatter must write exactly the [Key] members");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue