Prova 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Prova --version 0.2.0
                    
NuGet\Install-Package Prova -Version 0.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="Prova" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Prova" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Prova" />
                    
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 Prova --version 0.2.0
                    
#r "nuget: Prova, 0.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 Prova@0.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=Prova&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Prova&version=0.2.0
                    
Install as a Cake Tool

Prova πŸ‡ΈπŸ‡ͺ

Build Status License NuGet

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.

Comparison 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 test and 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 Assert suite (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

  1. Install Prova:

    dotnet add package Prova
    
  2. Write 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);
        }
    }
    
  3. Run:

    Option A: Direct Execution (Fastest / Recommended)

    dotnet run
    

    Option B: dotnet test (CI/CD / MTP) Prova fully supports the Microsoft Testing Platform. To use dotnet test, add a global.json to 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 test integration via the Microsoft.Testing.Platform runner.
  • TRX Report generation for Azure DevOps, GitHub Actions, and Jenkins.
  • Code Coverage: Built-in support for --coverage to generate coverage.xml or 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 fast dotnet run inner 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, Prova only 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.

  1. Mark a static method as a factory with [TestDependency].
  2. 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 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. 
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
0.3.0 40 1/28/2026
0.2.0 40 1/28/2026
0.1.1 42 1/27/2026