Installation
BDTest is distributed on NuGet. Install the adapter for your test framework. Each adapter depends on the core BDTest package, so you get both.
# TUnit (recommended)
dotnet add package TUnit
dotnet add package BDTest.TUnit
# NUnit
dotnet add package BDTest.NUnit
# xUnit v3 (Microsoft.Testing.Platform)
dotnet add package xunit.v3
dotnet add package BDTest.xUnit
# MSTest
dotnet add package BDTest.MSTest
The core BDTest package includes the source generator, including when installed through an adapter. It lets BDTest render [StepText], method names and supported argument values in reports automatically. See Step text.
The core package also includes compile-time checks and IDE fixes automatically, including through adapters. Remove old BDTest.Analyzers references when upgrading; that separate package is no longer produced. See Analyzers and code fixes for rule IDs and suppression.
To use BDTest without a framework adapter, install only the core package:
dotnet add package BDTest
For JSON/HTML export and HTTP uploads, add BDTest.Reporting alongside your adapter:
dotnet add package BDTest.Reporting
See reporting package migration. Execution and console output need no reporting reference.
For independent immutable report DTOs, add BDTest.Contracts. It has no dependency
on the execution package. See report contracts for its
versioned JSON shape and the current migration boundary.
For a report server, add BDTest.Razor.Reports to an ASP.NET Core project. Add
BDTest.Reports.Storage.FileSystem for persistent directory-based storage. Both
target .NET 10. See Report server setup and
Persistence.
Use the same version for every BDTest package in a solution. The adapters, the report server and the core package share data models.
Package naming policy
The package IDs in the table below stay unchanged for the next major version.
BDTest.xUnit retains its existing casing and supports xUnit v3.
BDTest.Razor.Reports uses the display title BDTest - ASP.NET Core Reports;
its package ID, namespaces and static asset paths remain unchanged. No package
rename is required for these runtime packages. The former standalone BDTest.Analyzers package is now bundled in BDTest; remove its old reference.
BDTest.ReportGenerator.RazorServer remains an unpacked sample application.
Storage packages use the BDTest.Reports.Storage.* prefix.
BDTest.Reports.Storage.FileSystem provides directory-based persistence;
BDTest.Reports.Storage.AzureBlob provides Azure Blob persistence. Custom stores use the
existing storage contracts.
Assembly versions
Starting with version 3.0.0, including prereleases, strong-named assemblies use
Major.0.0.0 as their assembly version. Minor and patch releases within that
major keep the same assembly identity. Package versions and file versions still
identify each release; informational versions and report version fields include
the full release version and source revision. The 2.x series keeps its existing
assembly version policy. Keep package versions aligned as described above, and
review migration notes when upgrading to a new major version.
Supported targets
The core BDTest package targets netstandard2.0;net8.0. Adapter and report server requirements differ:
| Package | Target framework | Test framework dependency |
|---|---|---|
BDTest | netstandard2.0;net8.0 | None |
BDTest.Reporting | netstandard2.0;net8.0 | None |
BDTest.Contracts | netstandard2.0 | None |
BDTest.TUnit | netstandard2.0;net8.0 | TUnit |
BDTest.NUnit | net8.0 | NUnit 5 |
BDTest.xUnit | netstandard2.0;net8.0 | xUnit v3 |
BDTest.MSTest | netstandard2.0;net8.0 | MSTest 4 |
BDTest.Razor.Reports | net10.0 | ASP.NET Core |
BDTest.Reports.Storage.FileSystem | net10.0 | ASP.NET Core report storage |
BDTest.Reports.Storage.AzureBlob | net10.0 | Azure Blob Storage / ASP.NET Core |
Source generator (bundled in BDTest) | netstandard2.0 analyzer | C# 10+ compiler (.NET SDK 8+) |
BDTest.Analyzers | netstandard2.0 analyzer | Roslyn 4.8+ (.NET SDK 8+) |
BDTest's step builders take delegates and need a C# 13 or newer compiler (.NET SDK 9 or newer). The core package retains its netstandard2.0 build alongside net8.0.
The policy preserves .NET Standard runtime assets and adds native .NET 8 assets wherever the adapter dependencies allow it. NUnit retains its .NET 8 floor; ASP.NET Core report hosting stays on .NET 10. Compiler extensions keep their .NET Standard compiler-host target and analyzer packaging. NuGet selects the .NET 8 build automatically for .NET 8+ consumers. See Target framework migration.
Choose a test project target that both the adapter and its test framework support. A netstandard2.0 adapter does not guarantee that its test framework or runner supports .NET Framework. The NUnit adapter requires .NET 8 or later.
Test project setup
A typical TUnit test project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BDTest.TUnit" Version="*" />
<PackageReference Include="TUnit" Version="*" />
</ItemGroup>
</Project>
TUnit test projects are executables that run on Microsoft.Testing.Platform; do not add Microsoft.NET.Test.Sdk. Replace * with the versions you want to pin. Continue with your first test.
For xUnit v3, use xunit.v3 with <OutputType>Exe</OutputType> and <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>, then run dotnet run --project <project>. Do not add VSTest packages to this setup. See xUnit setup for the complete MTP configuration, optional TRX reporting, and a VSTest fallback.