Skip to content

Test Coverage

All three client ecosystems (.NET, TypeScript, Swift) test against one shared IntegrationTestServer running real Kestrel. No mocking.

Summary

PlatformFrameworkTests
.NET Unit (SourceGenerator)xUnit3
.NET Unit (DynamicProxy)xUnit12
.NET Integration (JSON)xUnit50
.NET Integration (MessagePack)xUnit5
TypeScript Integration (JSON)vitest25
TypeScript Integration (MessagePack)vitest5
Swift UnitXCTest31
Swift MacroXCTest6
Swift IntegrationXCTest6

What's Tested

  • Client → Server: invoke (sync/async, multiple return types), send (fire-and-forget), echo, streaming (ChannelReader, IAsyncEnumerable)
  • Server → Client: fire-and-forget, typed proxy calls, return values (string, list, guid), streaming (IAsyncEnumerable), cancellation
  • Complex Types: DateTime, Guid, List, Dictionary, multiple parameter types
  • Multi-ServerMethods: second class on same hub, [MessageName] attribute, hub method coexistence
  • Authorization: authenticated calls (sync/async), unauthenticated rejection, token challenge/refresh, [AllowAnonymous] override, second ServerMethods class with hub-level auth
  • Error Handling: structured error types (ArgumentException, InvalidOperationException), non-existent method
  • File Transfer: RequestUploadSlot, HTTP upload, automatic Stream argument preparation, Stream return values
  • Advanced: [FromServices] injection, ClientContext.Attributes from headers
  • MessagePack: invoke, send, echo, guid, multi-param — same scenarios as JSON
  • Proxy Generation: ModuleInitializer registration, all 7 return type categories, method name format, CancellationToken extraction, fallback factory

Test Infrastructure

  • IntegrationTestServer — standalone .NET server, dynamic port, shared by all clients
  • scripts/test-server.sh — server lifecycle coordinator (acquire/release with ref counting)
  • scripts/run-integration-tests.sh — runs all available client tests in sequence
  • .NET fixture auto-starts server if no SIGNALARRR_TEST_SERVER_URL environment variable

Released under the Apache-2.0 License.