Skip to content

ANcpLua/DotNetTests

Repository files navigation

DotNetTests

Six .NET test frameworks side-by-side, tested against the same code: a Calculator, an Aspire-orchestrated WebApp + ApiService, a Blazor Counter component.

Use this repo to read the same test written six different ways.

AdvancedPatterns/ is the extra study project: reusable contract tests, in-memory protocol hosts, deterministic call expectations, JSON workflow harnesses, and adversarial file-store tests.

Frameworks

Folder Package
UnitTests/ IntegrationTests/ PlaywrightTests/ TUnit
XUnit/ xUnit v2
XUnitV3/ xUnit v3
NUnit/ NUnit 4
MSTest/ MSTest 4
BUnit/ bUnit
AdvancedPatterns/ xUnit v3 + ASP.NET TestServer

Run

dotnet build DotNetTests.slnx

dotnet test XUnit/XUnit.Tests.csproj
dotnet test NUnit/NUnit.Tests.csproj
dotnet test MSTest/MSTest.Tests.csproj
dotnet test BUnit/BUnit.Tests.csproj

cd UnitTests && dotnet run    # TUnit
cd XUnitV3   && dotnet run    # xUnit v3
dotnet run --project AdvancedPatterns/AdvancedPatterns.Tests.csproj

Live app

cd src/AppHost && dotnet run

Open the Aspire dashboard URL printed in the console. Requires Docker (for Redis).

Requirements

.NET 10 SDK · Docker (for AppHost and IntegrationTests)

Read first

AGENTS.md — layout, conventions, framework-specific gotchas.

About

Six .NET test frameworks side-by-side: TUnit, xUnit v2/v3, NUnit, MSTest, bUnit

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors