Bsft.Testing 2.2.0

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

Bsft.Testing

The test doubles and harnesses the framework's own suites use: a web application factory that boots an application with a resolved tenant and a fixed correlation id already in place, a fake OIDC authority, a fake Web Push service, a controllable clock, and in-process harnesses for the mediator and for sagas.

Install

dotnet add package Bsft.Testing

Requires Bsft.Correlation, Bsft.Data, Bsft.EventAggregator.Saga and Bsft.Mediator, plus Microsoft.AspNetCore.Mvc.Testing and the EF Core in-memory provider. It is marked a development dependency, so it does not flow transitively into anything a consumer publishes: its doubles replace production registrations wholesale, and that must never reach an application's own package graph.

Register

services.AddBsftTestContexts();                       // tenant and correlation doubles
services.AddBsftTestDatabase<AppDbContext>("orders"); // repoint a context at an in-memory store

Every method replaces rather than adds, so all of them are safe to call on a container an application has already fully configured — which is what BsftWebApplicationFactory<TEntryPoint> does. There is no single AddBsftTesting: a test picks the doubles it wants, and there is no sensible default set for a package whose whole purpose is to be selective.

Configure

None. The package binds no configuration section and exposes no options type; the doubles are handed their values in the constructor (new TestTenantContext("acme")) rather than configured.

Option Default Effect
— — —

Validation: AddBsftTestDatabase rejects a blank database name, and every method rejects a null argument.

Extend

BsftWebApplicationFactory<TEntryPoint> is designed for inheritance and is the intended entry point: derive from it, override ConfigureTestServices, and share the derived factory across a project's tests. A factory that brings doubles of its own kind overrides ConfigureTestDoubles and calls the base first. IFakeOidcAuthority (issues authorization codes, tokens and back-channel logout tokens for a federated-login test), IFakePushService (receives and decrypts Web Push deliveries), ITestEnvironmentPolicy (decides whether the host counts as a test host, for a test-only scheme that must refuse to run anywhere else) and ITestClock (a TimeProvider a test advances) are the replaceable seams. IMediatorTestHarness and ISagaTestHarness are built through their builders rather than resolved, so a test composes exactly the handlers it wants.

Documentation

Topic page: docs/testing.md. Conventions: docs/package-conventions.md.

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 was computed.  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 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
2.2.0 60 10/23/2026
2.1.0 121 9/28/2026