Prova 0.2.0
See the version list below for details.
dotnet add package Prova --version 0.2.0
NuGet\Install-Package Prova -Version 0.2.0
<PackageReference Include="Prova" Version="0.2.0" />
<PackageVersion Include="Prova" Version="0.2.0" />
<PackageReference Include="Prova" />
paket add Prova --version 0.2.0
#r "nuget: Prova, 0.2.0"
#:package Prova@0.2.0
#addin nuget:?package=Prova&version=0.2.0
#tool nuget:?package=Prova&version=0.2.0
Prova πΈπͺ
Research Project: Prova is a reference implementation for Native AOT testing patterns. It is community-driven and not an official Microsoft product.
Prova is a next-generation testing framework for .NET, built for Speed, Native AOT, and Developer Experience.
Documentation IS the test output.
βοΈ The Kill Sheet
Why switch? Prova gives you the modern benefits of TUnit without the learning curve of a new syntax.
| Feature | xUnit v2/v3 | TUnit | Prova |
|---|---|---|---|
| Runtime | Reflection (Slow) | AOT Optimized | Native AOT (Instant) |
| Syntax | Standard ([Fact]) |
New Fluent API | Standard ([Fact]) |
| Discovery | Runtime Scan | Source Gen | Source Gen |
| Parallelism | Assemblly Level | Class Level | Class Level (Default) |
| Migration Cost | - | High (Rewrite) | Zero (Copy-Paste) |
| User Experience | Plain Text | Modern | Rich + Magic Docs |
β¨ Features
- β‘ Zero Reflection / Native AOT: Fully compatible with
PublishAot. No runtime discovery cost. Start time: 0ms. - π True Parallelism: Test Classes run concurrently by default (
Task.WhenAll), maximizing CPU usage. - π MTP Ready: Fully supports the Microsoft Testing Platform. Works with
dotnet testand TRX reporting. - π§ββοΈ Magic Documentation: Your
/// <summary>test comments are automatically extracted and displayed in the runner output. - π¦ xUnit Parity: Don't rewrite your tests. Just change the runner.
[Fact],[Theory],[InlineData],[MemberData]IClassFixture<T>(Isolated Fixtures)IAsyncLifetime(Async Setup/Teardown)[Trait]categories & filtering- Full
Assertsuite (Equal,Throws,Contains,Single, etc.)
- π‘οΈ Enterprise Ready:
[Retry(3)]: Automatic retry logic for flaky tests.[Parallel(max: 4)]: Explicit concurrency control to prevent thread pool choking.[Focus]: Exclusive execution mode (Jest-style.only).
π‘οΈ The Nordic Suite
Prova is part of the Nordic Suite of developer tools. It is designed to work perfectly with Skugga, our AOT-native mocking library.
Integration Magic: Prova automatically detects Skugga mocks (fields starting with Mock<T>) and generates a finally { mock.VerifyAll(); } block for you. This ensures strict mock behavior without boilerplate, and with zero hard dependency on Skugga.
Learn more about Skugga Integration.
π Quick Start
Install Prova:
dotnet add package ProvaWrite a Test:
using Prova; public class CalculatorTests { [Fact] public void Add_ReturnsSum() { Assert.Equal(4, 2 + 2); } /// <summary> /// Simple division test β /// </summary> [Theory] [InlineData(10, 2, 5)] public void Divide_ReturnsQuotient(int a, int b, int expected) { Assert.Equal(expected, a / b); } }Run:
Option A: Direct Execution (Fastest / Recommended)
dotnet runOption B:
dotnet test(CI/CD / MTP) Prova fully supports the Microsoft Testing Platform. To usedotnet test, add aglobal.jsonto your solution root:{ "test": { "runner": "Microsoft.Testing.Platform" } }Then run:
dotnet test --project MyTestProject.csproj
π Microsoft Testing Platform (MTP) Support
Prova is a first-class citizen in the modern .NET testing ecosystem. By integrating the Hybrid MTP Adapter, Prova provides:
- Full
dotnet testintegration via theMicrosoft.Testing.Platformrunner. - TRX Report generation for Azure DevOps, GitHub Actions, and Jenkins.
- Code Coverage: Built-in support for
--coverageto generatecoverage.xmlor Cobertura reports. - In-process test execution with zero reflection overhead.
Check out the MTP Sample for a complete example.
π Code Coverage
To generate code coverage, use the --coverage flag:
# Generate Cobertura coverage report
dotnet run -- --coverage --coverage-output-format cobertura
# Report is generated in ./TestResults/*.cobertura.xml
AOT Coverage: Code coverage currently works primarily in JIT mode. Support for Native AOT coverage is an evolving area in the .NET ecosystem.
Prova tests compile into a stand-alone Console Application, not a Class Library.
- 0ms Startup: We control the entry point (
Main). No VSTest adapter overhead. - MTP via
dotnet run: Get the full Microsoft Testing Platform experience (TRX, etc.) without leaving the fastdotnet runinner loop. - Debuggable: Just hit F5. It's just a console app!
- Cloud-Ready: Compile to a single Native AOT binary and dropship it to any container.
π οΈ Developer Experience
Focus Mode
Working on a specific test? Don't run the whole suite. Just add [Focus].
[Fact]
[Focus] // <--- Only this test will run!
public void MyNewFeature() { ... }
Why
[Focus]?
- Zero Overhead: Unlike runtime filtering,
Provaonly generates code for focused tests. Skipped tests aren't even allocated.- Convenience: No more complex CLI args like
dotnet test --filter "FullyQualifiedName~MyTest". Just tag and run.
Retry Flaky Tests
Have a test that fails sporadically?
[Fact]
[Retry(3)] // <--- Retries up to 3 times before failing
public void NetworkTest() { ... }
Explicit Concurrency Control
Running 1000s of tests in parallel can choke the thread pool. Prova lets you bound parallelism per class or globally.
[Parallel(max: 4)] // <--- Only 4 tests in this class run concurrently
public class ResourceHeavyTests { ... }
Output Capture
Standard Console.WriteLine can be messy in parallel tests. Use ITestOutputHelper to capture logs per-test.
public class MyTests
{
private readonly ITestOutputHelper _output;
public MyTests(ITestOutputHelper output) => _output = output;
[Fact]
public void DebugSomething()
{
_output.WriteLine("This log appears attached to the test result! π");
}
}
Dependency Injection (AOT-Safe)
Prova uses a compile-time "Explicit Factory" pattern for DI. No containers, no reflection.
- Mark a static method as a factory with
[TestDependency]. - Inject the type into your test constructor.
public static class TestDependencies
{
[TestDependency]
public static IService CreateService() => new MyService(); // π
}
public class MyTests
{
private readonly IService _service;
public MyTests(IService service) => _service = service; // π Injected!
[Fact]
public void TestService() => Assert.NotNull(_service);
}
π€ Contributing
We love contributions! Please read our CONTRIBUTING.md to get started.
π License
Prova is fully open source and licensed under MIT.
| 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
- Microsoft.Testing.Extensions.CodeCoverage (>= 18.3.2)
- Microsoft.Testing.Extensions.TrxReport (>= 2.0.2)
- Microsoft.Testing.Extensions.TrxReport.Abstractions (>= 2.0.2)
- Microsoft.Testing.Platform (>= 2.0.2)
- Microsoft.Testing.Platform.MSBuild (>= 2.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.