Zentient.Testing 0.1.0-alfa

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

Zentient.Testing

Lightweight test harness, minimal mock engine, and scenario DSL (Arrange → Act → Assert).

Zentient.Testing provides a compact, dependency-light testing framework intended for fast, readable tests of handler-style components. The alpha release focuses on ergonomics and a small, stable public surface; advanced DI and mocking adapters are planned for future releases.

Highlights (Alpha)

  • Small public surface in Zentient.Abstractions.Testing: ITestScenario, ITestHarnessBuilder, IMockBuilder, IResultAssertions.
  • Lightweight implementation in Zentient.Testing: TestHarness, MockBuilder, ResultAssertions and a tiny mock engine.
  • Multi-targeted to .NET 8 and .NET 9.

Quickstart

Install the alpha package from your feed (or local artifacts):

dotnet add package Zentient.Testing --version 0.1.0-alpha.1

Minimal example

// Arrange: create scenario that constructs/resolves a handler from the harness
var scenario = TestScenario.ForHandler<MyHandler, MyInput, MyResult>((h, input, ct) => Task.FromResult(h.Handle(input)));

scenario.Arrange(builder =>
{
    builder.WithDependency<IMyRepository>(new InMemoryRepository());
    builder.WithMock<IMyService>(m => m.Given(x => x.Calculate(It.IsAny<int>())).ThenReturns(42));
});

// Act
var result = await scenario.ActAsync(new MyInput());

// Assert
scenario.Assert(a => a.NotBeNull());
scenario.Assert(a => a.With(r => r.Value, 42));

Documentation

See the docs/ folder for detailed information:

  • Architecture and design principles
  • API reference and usage examples
  • Packaging and release notes

Running tests & local validation

  • Tests in this repository use xUnit for discovery. Run them with:
    dotnet test
    
  • For local CI-style validation (build → test → pack) use the included script:
    ..\ulfbou\scripts\validate.ps1
    

Contributing

Contributions are welcome. Please respect the Code of Conduct and follow contribution guidelines in the repository.

License

MIT — see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 was computed.  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.0-alfa 248 9/18/2025

Build Information:
- Built on: 2025-09-18T13:31:25.931Z
- Configuration: Release
- Target Framework:
- Version:
- Commit: ac6a6c4807c159f923e4b406729c2fc98503202a
- Branch: main