Sylin.Koan.Testing 0.20.3

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

Sylin.Koan.Testing

Your application inherits a test suite. Reference this package from an xUnit v3 test project, subclass EntityConformanceSpecs<TEntity> once per Entity, and implement one business-valid factory method. Koan supplies the common persistence and capability batteries through the real application composition path.

Install

dotnet add package Sylin.Koan.Testing

Choose it when

  • an application-owned Entity should retain basic persistence behavior as its model evolves;
  • a coding agent needs one canonical way to add broad, capability-aware integration coverage;
  • a provider change must be checked through the same AddKoan() discovery path used by the app;
  • reviewers want tests that read as one business-valid example rather than infrastructure wiring.

Use Koan.Testing.Hosting when you need a custom compiled-composition host without inherited batteries. Use Koan.Testing.Containers for adapter development against reusable real backing-store fixtures.

Meaningful result: add one class per Entity

using Koan.Testing;

public sealed class TodoConformance : EntityConformanceSpecs<Todo>
{
    protected override Todo NewValid() => new() { Title = "Ship the meaningful step" };
}

That class inherits six batteries:

Battery Meaning
Round trip A valid Entity saves, receives an id, and reads back.
Paging Paging returns every seeded row exactly once.
Query pushdown A capable adapter agrees with Koan's in-memory filter oracle.
Partition isolation A write in one partition is invisible in another.
Cache invalidation A [Cacheable] Entity is not served stale after deletion.
Embedding save path An [Embedding] declaration never blocks the persistence path.

Cache and embedding batteries skip when the Entity does not declare those traits. Query pushdown skips when the selected adapter does not declare the required capability.

Override Configure(IDictionary<string, string?>) only to select an adapter or supply test configuration. NewValid() is the complete Entity extension surface.

Host isolation is automatic

Conformance batteries boot real generic hosts and bind every Entity operation to the creating host's async flow. Independent conformance classes can use normal xUnit scheduling; no assembly-level DisableTestParallelization attribute is required. Host startup/teardown still uses Koan's owner-checked generic-host binder, so an older battery cannot clear a newer host owner.

This contract isolates Koan host/provider selection, Entity partitions, and temporary roots. A test suite that deliberately points multiple classes at the same external database, queue, container, or other shared resource still owns that resource's scheduling policy.

Backing stores and failures

Each battery uses an isolated temporary root and a unique Entity partition. Override Configure to select inmemory for a Docker-free run or to provide a real external adapter.

Only missing capabilities and absent model traits skip their inapplicable batteries. Host startup, composition, provider access, and Entity-operation failures retain their original exception and fail the test. A missing database is not evidence that its provider conforms.

Limits

  • These are correctness batteries, not performance or load tests.
  • The universal query battery filters on Id; application-specific predicates still deserve tests.
  • The embedding battery protects the save path, not end-to-end vector synchronization.
  • Flow-scoped hosts and data partitions isolate independent conformance specifications; explicitly shared external infrastructure is outside that boundary.
  • The suite does not replace business invariants or multi-Entity workflow tests.

See TECHNICAL.md for the lifecycle and gating contract and docs/guides/testing-your-app.md for framework-wide testing guidance.

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.20.3 80 7/22/2026
0.20.2 133 7/22/2026