TestExtensionsAspire 94.2025.805.2239

dotnet add package TestExtensionsAspire --version 94.2025.805.2239
                    
NuGet\Install-Package TestExtensionsAspire -Version 94.2025.805.2239
                    
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="TestExtensionsAspire" Version="94.2025.805.2239" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TestExtensionsAspire" Version="94.2025.805.2239" />
                    
Directory.Packages.props
<PackageReference Include="TestExtensionsAspire" />
                    
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 TestExtensionsAspire --version 94.2025.805.2239
                    
#r "nuget: TestExtensionsAspire, 94.2025.805.2239"
                    
#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 TestExtensionsAspire@94.2025.805.2239
                    
#: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=TestExtensionsAspire&version=94.2025.805.2239
                    
Install as a Cake Addin
#tool nuget:?package=TestExtensionsAspire&version=94.2025.805.2239
                    
Install as a Cake Tool

TestExtensionsAspire

Extension methods for .NET Aspire that add test project integration capabilities to your distributed applications.

Features

  • Test Project Integration: Add test projects as resources in your Aspire application
  • Command Execution: Execute test commands with custom filters
  • Explicit Start Control: Tests start only when explicitly triggered
  • Logging Integration: Full integration with Aspire's logging system
  • Custom Commands: Support for multiple test filters and custom command names

Installation

Install via NuGet:

dotnet add package TestExtensionsAspire

Usage

Basic Setup

using TestExtensionsAspire;

var builder = DistributedApplication.CreateBuilder(args);

// Add a test project with custom filters
builder.AddTestProject<Projects.MyApp_Tests>("MyTests",
    "run --filter-trait 'Category=UnitTest'",
    "run --filter-trait 'Category=Integration'");

builder.Build().Run();

Adding Test Projects

The AddTestProject method allows you to add test projects to your Aspire application:

// Add test project with multiple test commands
builder.AddTestProject<Projects.TestExtensions_Tests>("SampleTests",
    "run --filter-trait 'Category=UnitTest'",
    "run --filter-trait 'Category=Logic'",
    "run --filter-trait 'Category=Integration'");

Features

  • Explicit Start: Test projects are added with WithExplicitStart(), meaning they won't run automatically when the application starts
  • Custom Commands: Each test filter becomes a separate command that can be executed independently
  • Logging: All test output is logged through the Aspire logging system
  • Process Management: Handles test process execution with proper timeout and error handling

Command Options

Each test command includes:

  • Custom icon (PersonRunningFilled)
  • Display name showing the actual dotnet command
  • Error handling and logging
  • 5-minute timeout for test execution

Requirements

  • .NET 9.0 or later
  • .NET Aspire 9.4.0 or later
  • A valid test project implementing IProjectMetadata

API Reference

AddTestProject<TProject>

public static IResourceBuilder<ProjectResource> AddTestProject<TProject>(
    this IDistributedApplicationBuilder builder, 
    string name, 
    params string[] arguments)
    where TProject : IProjectMetadata, new()

Parameters:

  • builder: The distributed application builder
  • name: Name for the test resource
  • arguments: Array of test command arguments (e.g., dotnet test filters)

Returns:

  • IResourceBuilder<ProjectResource> that can be further configured

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 was computed.  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
94.2025.805.2239 206 8/5/2025
94.2025.804.1054 175 8/4/2025

Initial release with test project integration for .NET Aspire applications.