Franz.Common.Testing
3.0.0
dotnet add package Franz.Common.Testing --version 3.0.0
NuGet\Install-Package Franz.Common.Testing -Version 3.0.0
<PackageReference Include="Franz.Common.Testing" Version="3.0.0" />
<PackageVersion Include="Franz.Common.Testing" Version="3.0.0" />
<PackageReference Include="Franz.Common.Testing" />
paket add Franz.Common.Testing --version 3.0.0
#r "nuget: Franz.Common.Testing, 3.0.0"
#:package Franz.Common.Testing@3.0.0
#addin nuget:?package=Franz.Common.Testing&version=3.0.0
#tool nuget:?package=Franz.Common.Testing&version=3.0.0
Franz.Common.Testing
Lightweight unit-test base class and test-only Mediator dispatcher helpers.
Overview
This package contains a reusable UnitTest base class and a lightweight in-memory TestDispatcher. It is a test utility package, not a production dispatcher or a complete replacement for the production Mediator runtime.
Installation
dotnet add package Franz.Common.Testing
UnitTest base class
Derive a test fixture from UnitTest to get a strict Moq MockRepository and a deterministic current/UI culture:
public sealed class CustomerServiceTests : UnitTest
{
[Fact]
public void Example()
{
var dependency = MockRepository.Create<ICustomerDependency>();
// Arrange, act, assert.
}
}
The default constructor uses the package's default culture. An overload accepts an explicit culture name. On disposal, the base class calls MockRepository.VerifyAll().
TestDispatcher
Franz.Common.Testing.Mediator.TestDispatcher supports direct registration of command, query, notification, and stream-query handlers, plus selected request/notification pipelines and pre/post-processors.
var dispatcher = new TestDispatcher()
.WithHandler<GetCustomerQuery, CustomerDto>(handler);
var result = await dispatcher.SendAsync<CustomerDto>(
new GetCustomerQuery(customerId),
cancellationToken);
The dispatcher uses dynamic invocation and is annotated as requiring dynamic code and unreferenced members. It is intended for unit tests and is not Native AOT compatible.
Coverage boundary: the current implementation throws NotImplementedException for Send(INotification) and PublishEventAsync. Its non-generic SendAsync(ICommand) wrapper path also does not resolve the original command handler reliably. Do not use those paths in tests expecting production-equivalent dispatch. Use the production dispatcher in integration tests for behavior that depends on the full dispatch surface.
License
MIT. See the repository LICENSE.
| 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
- FluentAssertions (>= 8.10.0)
- Franz.Common.Mediator (>= 3.0.0)
- MockQueryable.Moq (>= 10.0.8)
- Moq.AutoMock (>= 4.0.2)
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 |
|---|---|---|
| 3.0.0 | 33 | 11/10/2026 |
| 2.3.4 | 344 | 11/1/2026 |
| 2.3.3 | 95 | 10/28/2026 |
| 2.3.2 | 113 | 10/27/2026 |
| 2.3.1 | 98 | 10/26/2026 |
| 2.3.0 | 153 | 7/21/2026 |
| 2.2.19 | 128 | 7/19/2026 |
| 2.2.18 | 135 | 7/19/2026 |
| 2.2.17 | 135 | 7/12/2026 |
| 2.2.16 | 138 | 7/2/2026 |
| 2.2.15 | 132 | 6/29/2026 |
| 2.2.14 | 133 | 6/29/2026 |
| 2.2.13 | 139 | 6/29/2026 |
| 2.2.12 | 139 | 6/28/2026 |
| 2.2.11 | 145 | 6/28/2026 |
| 2.2.10 | 138 | 6/28/2026 |
| 2.2.9 | 159 | 6/28/2026 |
| 2.2.8 | 145 | 6/28/2026 |
| 2.2.7 | 152 | 6/7/2026 |
| 2.2.6 | 140 | 6/6/2026 |