Lakona.Game.Testing 0.1.6

dotnet add package Lakona.Game.Testing --version 0.1.6
                    
NuGet\Install-Package Lakona.Game.Testing -Version 0.1.6
                    
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="Lakona.Game.Testing" Version="0.1.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lakona.Game.Testing" Version="0.1.6" />
                    
Directory.Packages.props
<PackageReference Include="Lakona.Game.Testing" />
                    
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 Lakona.Game.Testing --version 0.1.6
                    
#r "nuget: Lakona.Game.Testing, 0.1.6"
                    
#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 Lakona.Game.Testing@0.1.6
                    
#: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=Lakona.Game.Testing&version=0.1.6
                    
Install as a Cake Addin
#tool nuget:?package=Lakona.Game.Testing&version=0.1.6
                    
Install as a Cake Tool

Lakona.Game.Testing

dotnet add package Lakona.Game.Testing

Lakona.Game.Testing hosts multiple real Lakona server nodes in one test process. Each node has its own Generic Host and dependency-injection container, while the nodes share an in-memory Membership Table and communicate through an in-memory cluster transport.

Use it for integration tests which need the real Membership, Actor Directory, activation catalog, routing, and node lifecycle without starting several OS processes:

await using var cluster = new LakonaTestClusterBuilder()
    .AddNode("data-1", "data")
    .AddNode("battle-1", "battle")
    .ConfigureNodes(node =>
    {
        node.UseHotfixAssembly(typeof(GameHotfixStartup).Assembly);

        if (node.HasRole("data"))
        {
            node.ConfigureAppConfiguration(configuration =>
                configuration.AddInMemoryCollection(new Dictionary<string, string?>
                {
                    ["ConnectionStrings:GameDatabase"] = database.ConnectionString
                }));
        }
    })
    .Build();

await cluster.StartAsync();
await cluster.WaitForMembershipAsync();

cluster.Network.Partition("data-1", "battle-1");
cluster.Network.Heal("data-1", "battle-1");

await cluster.RestartNodeAsync("battle-1");
await cluster.WaitForMembershipAsync();

cluster.Network.Partition("gateway-1", "battle-1") blocks both directions. Use BlockOneWay(source, target) and HealOneWay(source, target) when a test needs an asymmetric failure, such as requests failing while replies in the opposite direction can still travel.

cluster.Network.BlockedLinks exposes a stable snapshot for assertions and is included in membership-convergence timeout messages. Cluster disposal stops nodes with live Actors first, waits for the remaining membership view between nodes, and still attempts transport cleanup when an application hosted service throws during shutdown.

UseHotfixAssembly loads the generated Actor API and Hotfix behavior table into each real test host. Node roles still decide which Actor types a node advertises, so calls issued through ActorAccess exercise normal placement, Directory, cluster RPC, mailbox dispatch, and lifecycle behavior.

The test fixture owns application dependencies such as PostgreSQL, MySQL, and Redis. Start a container or other disposable test resource in the fixture, then inject its connection string only into the node roles which use it. This package deliberately does not start those products or pretend to implement their behavior.

The in-memory table and transport make tests fast and deterministic, but they do not test PostgreSQL SQL behavior, real sockets, TLS, container networking, or separate-process crashes. Keep provider contract tests and a smaller number of process/container E2E tests for those boundaries.

Product Compatible and additional computed target framework versions.
.NET 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. 
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
0.1.6 37 8/26/2026