XBullet.EasyTesting.Aspire
1.0.13
dotnet add package XBullet.EasyTesting.Aspire --version 1.0.13
NuGet\Install-Package XBullet.EasyTesting.Aspire -Version 1.0.13
<PackageReference Include="XBullet.EasyTesting.Aspire" Version="1.0.13" />
<PackageVersion Include="XBullet.EasyTesting.Aspire" Version="1.0.13" />
<PackageReference Include="XBullet.EasyTesting.Aspire" />
paket add XBullet.EasyTesting.Aspire --version 1.0.13
#r "nuget: XBullet.EasyTesting.Aspire, 1.0.13"
#:package XBullet.EasyTesting.Aspire@1.0.13
#addin nuget:?package=XBullet.EasyTesting.Aspire&version=1.0.13
#tool nuget:?package=XBullet.EasyTesting.Aspire&version=1.0.13
XBullet.EasyTesting.Aspire
Closed-box distributed application testing helpers for .NET Aspire.
The package targets .NET 8, .NET 9, and .NET 10. Use it when a test needs the complete AppHost topology;
keep using WebApplicationFactory and XBullet.EasyTesting for fast, single-service in-memory tests.
Install
dotnet add package XBullet.EasyTesting.Aspire
Example
Reference the AppHost project from the test project, then start the distributed application and wait for the resources the test depends on:
await AspireTestHost.Create<Projects.Orders_AppHost>()
.WaitForResource("api")
.WaitForResource("frontend")
.RunAsync(async (application, cancellationToken) =>
{
using var client = application.CreateHttpClient("frontend");
using var response = await client.GetAsync("/orders/42", cancellationToken);
response.EnsureSuccessStatusCode();
}, cancellationToken);
Aspire assigns isolated endpoints and starts the resources declared by the AppHost. The configured startup timeout covers both AppHost startup and resource health checks. Unavailable resources stop the wait immediately instead of consuming the complete timeout.
Use WithArguments(...) for AppHost command-line arguments and ConfigureAppHost(...) when the
native IDistributedApplicationTestingBuilder needs test-specific configuration. For manual
lifetime control, call StartAsync and dispose the returned application asynchronously.
Failure diagnostics
RunAsync captures an AspireApplicationDiagnostics snapshot before shutdown when the test fails
and attaches it to exception.Data[AspireApplicationDiagnostics.ExceptionDataKey]. The snapshot
contains each resource's current state, health status, exit code, and bounded recent console logs.
Connection strings and endpoint values are intentionally excluded.
Diagnostics can also be captured explicitly:
await using var application = await AspireTestHost.Create<Projects.Orders_AppHost>()
.WaitForResource("api")
.StartAsync(cancellationToken);
var diagnostics = await application.CaptureDiagnosticsAsync(cancellationToken);
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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 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
- Aspire.Hosting.Testing (>= 13.5.4)
- XBullet.EasyTesting (>= 1.0.13)
-
net8.0
- Aspire.Hosting.Testing (>= 13.5.4)
- XBullet.EasyTesting (>= 1.0.13)
-
net9.0
- Aspire.Hosting.Testing (>= 13.5.4)
- XBullet.EasyTesting (>= 1.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.