Kanject.Core.Realtime.TestKit 1.3.0

Prefix Reserved
dotnet add package Kanject.Core.Realtime.TestKit --version 1.3.0
                    
NuGet\Install-Package Kanject.Core.Realtime.TestKit -Version 1.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Kanject.Core.Realtime.TestKit" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kanject.Core.Realtime.TestKit" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Kanject.Core.Realtime.TestKit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Kanject.Core.Realtime.TestKit --version 1.3.0
                    
#r "nuget: Kanject.Core.Realtime.TestKit, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Kanject.Core.Realtime.TestKit@1.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Kanject.Core.Realtime.TestKit&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Kanject.Core.Realtime.TestKit&version=1.3.0
                    
Install as a Cake Tool

Kanject.Core.Realtime.TestKit

The contract suite every realtime transport passes (Core proposal 0058 §5), plus doubles for a product's own tests.

Installation

dotnet add package Kanject.Core.Realtime.TestKit

Targets .NET 9, .NET 10 and .NET 11. It is an xUnit kit, not a test project: your test project brings its own xunit and runner.

Testing a product

RecordingRealtimePublisher stands in for IRealtimePublisher. It records each publish as the envelope a client would receive and holds it to the same message-type and payload-ceiling rules:

var realtime = new RecordingRealtimePublisher();
await new ConversationBroadcaster(realtime).MessageAddedAsync(conversation, added, ct);

var published = Assert.Single(realtime.Published);
Assert.Equal("message_added", published.Envelope.Type);

InProcessRealtimeTransportHost runs the in-process transport end to end with any authorizer. TestRealtimeAuthorizer issues tokens for users and decides topics through a predicate.

Testing a transport

A provider derives from RealtimeTransportContractTests and returns its transport through an IRealtimeTransportHost:

public sealed class MyTransportContractTests : RealtimeTransportContractTests
{
    protected override Task<IRealtimeTransportHost> CreateHostAsync(TestRealtimeAuthorizer authorizer) =>
        Task.FromResult<IRealtimeTransportHost>(new MyTransportHost(authorizer));
}

The suite covers the publish contract and Core's subscription rules:

  • delivery to a user, to several users and to a topic, and to nobody else;
  • the payload ceiling;
  • the envelope's fields;
  • refusal of another user's channel, a wildcard, another tenant, an expired principal and a refused topic.

A test the transport's capabilities rule out is skipped, not failed.

License

Licensed under the Kanject Code Libraries License Agreement (KCLLA); the full text ships in this package as LICENSE.md. Organizations whose trailing-twelve-month gross revenue and total funding raised are each below US$250,000 may use it at no cost under the Free Tier. At or above either threshold a commercial license is required — contact commercial@kanjectbusiness.com.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 8 11/26/2026
1.2.0 50 11/26/2026
1.1.0 55 11/26/2026
1.0.0 56 11/24/2026

- Takes Kanject.Core.Realtime 1.3.0.