CultLib/tests/GameCult.Networking.Tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens 7c4bc2bdc0 Make generated and reflective document members one rule
The generator and CultDocumentRegistry now discover members by the same
steps: most-derived declaration first, override chain collapsed to one
member, attributes read up the override chain, rejections in one order
with one text (GCC001 / InvalidOperationException).

- Accessors are named per document, so documents sharing a [CultName] or
  [CultIndex] base member no longer emit duplicate methods (CS0111).
- Duplicate [Key] slots are refused, including new-hidden fields and
  properties; a hidden persisted member with a different slot is refused.
- String [Key("x")] gets its own message instead of "has no [Key]".
- A persisted property whose set accessor is private, protected or init,
  or a readonly field, is refused instead of CS0272 in generated code.
- Overrides: MessagePack's DynamicObjectResolver reads the base
  declaration's [Key]/[IgnoreMember] (it throws "key is duplicated" for a
  re-keyed override and serializes an override marked [IgnoreMember]).
  An override that changes them is refused in both paths; an override
  that repeats or omits them is accepted and byte-pinned.
- Typed Serialize<T>/Deserialize<T> used static Options and skipped
  generated codecs and declared resolvers; deleted. CultNetDocumentBinding
  and CultMeshSnapshots route through the untyped path with their registry.

DocumentShapeSweepTests compiles each shape through the generator and
compares generated vs reflective schema id, catalog, name/index values
and payload against MessagePack's own bytes, or equal rejection text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:00:16 +02:00
..
CultNetDocumentBindingResolverTests.cs Make generated and reflective document members one rule 2026-09-13 22:00:16 +02:00
CultNetOperationServerTests.cs Bind CultMesh authority identity to physical routes 2026-08-18 17:21:58 +02:00
CultNetSchemaServerGroupTests.cs Share CultNet handlers across transports 2026-08-18 01:31:04 +02:00
GameCult.Networking.Tests.csproj Add GameCult Mesh package home 2026-05-19 19:08:48 +01:00
NetworkingTests.cs Make generated and reflective document members one rule 2026-09-13 22:00:16 +02:00
README.md JSON backing store, I/O fixes, Networking Security 2026-04-18 13:01:24 +01:00

GameCult.Networking.Tests

GameCult.Networking.Tests contains NUnit tests for the networking library.

Scope

The tests currently cover:

  • AES-GCM encrypt/decrypt round-trips in Secret
  • signed session-token validation
  • signed session-token tamper detection
  • signed session-token expiry handling

Run

dotnet test tests\GameCult.Networking.Tests\GameCult.Networking.Tests.csproj

Adding New Tests

Typical future areas to expand include:

  • client reconnect and verify flows
  • login and registration integration tests
  • malformed message handling
  • rate-limiting behavior under concurrency