Zentient.Testing
0.1.0-alfa
dotnet add package Zentient.Testing --version 0.1.0-alfa
NuGet\Install-Package Zentient.Testing -Version 0.1.0-alfa
<PackageReference Include="Zentient.Testing" Version="0.1.0-alfa" />
<PackageVersion Include="Zentient.Testing" Version="0.1.0-alfa" />
<PackageReference Include="Zentient.Testing" />
paket add Zentient.Testing --version 0.1.0-alfa
#r "nuget: Zentient.Testing, 0.1.0-alfa"
#:package Zentient.Testing@0.1.0-alfa
#addin nuget:?package=Zentient.Testing&version=0.1.0-alfa&prerelease
#tool nuget:?package=Zentient.Testing&version=0.1.0-alfa&prerelease
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 | Versions 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. |
-
net8.0
- Zentient.Abstractions.Testing (>= 0.1.0-alfa)
-
net9.0
- Zentient.Abstractions.Testing (>= 0.1.0-alfa)
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