TestExtensionsAspire 94.2025.805.2239
dotnet add package TestExtensionsAspire --version 94.2025.805.2239
NuGet\Install-Package TestExtensionsAspire -Version 94.2025.805.2239
<PackageReference Include="TestExtensionsAspire" Version="94.2025.805.2239" />
<PackageVersion Include="TestExtensionsAspire" Version="94.2025.805.2239" />
<PackageReference Include="TestExtensionsAspire" />
paket add TestExtensionsAspire --version 94.2025.805.2239
#r "nuget: TestExtensionsAspire, 94.2025.805.2239"
#:package TestExtensionsAspire@94.2025.805.2239
#addin nuget:?package=TestExtensionsAspire&version=94.2025.805.2239
#tool nuget:?package=TestExtensionsAspire&version=94.2025.805.2239
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 buildername
: Name for the test resourcearguments
: 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 | Versions 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. |
-
net9.0
- Aspire.Hosting.AppHost (>= 9.4.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.7)
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.