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
<PackageReference Include="Lakona.Game.Testing" Version="0.1.6" />
<PackageVersion Include="Lakona.Game.Testing" Version="0.1.6" />
<PackageReference Include="Lakona.Game.Testing" />
paket add Lakona.Game.Testing --version 0.1.6
#r "nuget: Lakona.Game.Testing, 0.1.6"
#:package Lakona.Game.Testing@0.1.6
#addin nuget:?package=Lakona.Game.Testing&version=0.1.6
#tool nuget:?package=Lakona.Game.Testing&version=0.1.6
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 | Versions 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. |
-
net10.0
- Lakona.Game.Server (>= 0.41.12)
- Lakona.Rpc.Transport.Loopback (>= 0.11.17)
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 |