aspire-integration-testing

Create xUnit integration tests for .NET Aspire applications with real infrastructure dependencies.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill aspire-integration-testing-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aspire-integration-testing
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/aspire-integration-testing
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill aspire-integration-testing-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies writing robust integration tests for .NET Aspire applications by leveraging real infrastructure dependencies and xUnit, ensuring your distributed applications function correctly in production-like environments.

Core Features & Use Cases

  • Real Dependency Testing: Test against actual databases, caches, and services orchestrated by .NET Aspire, not mocks.
  • Dynamic Endpoint Discovery: Automatically find service endpoints at runtime, avoiding hardcoded URLs.
  • Fixture Management: Utilizes IAsyncLifetime for proper setup and teardown of test environments.
  • Use Case: You need to verify that your ASP.NET Core API correctly interacts with a real PostgreSQL database and Redis cache, all managed by .NET Aspire, before deploying to production.

Quick Start

Use the aspire-integration-testing skill to write an integration test for your .NET Aspire application using xUnit.

Frequently Asked Questions about aspire-integration-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write integration tests for .NET Aspire distributed applications?

You can write integration tests for .NET Aspire distributed applications using xUnit test fixtures that manage the application lifecycle, resolve dynamic endpoints, and verify service health checks against real infrastructure dependencies.

What is the best way to test .NET Aspire microservices with real dependencies?

Testing .NET Aspire microservices with real dependencies involves orchestrating actual databases and services instead of mocks. xUnit fixtures using IAsyncLifetime manage environment setup and teardown, verifying distributed application components reliably.

How do I resolve service endpoints dynamically in .NET Aspire integration tests?

Dynamic endpoint resolution in .NET Aspire integration tests automatically discovers service URLs at runtime, avoiding hardcoded addresses. The testing framework handles this discovery during fixture setup, allowing your xUnit tests to connect to orchestrated services reliably.

Does .NET Aspire integration testing work with xUnit and IAsyncLifetime?

.NET Aspire integration testing works with xUnit by implementing IAsyncLifetime to manage test fixture setup and teardown. This combination handles the distributed application lifecycle and ensures real dependencies initialize before test execution.

Why use real infrastructure dependencies instead of mocks for .NET Aspire API testing?

Real infrastructure dependencies in .NET Aspire API testing verify actual interactions with databases like PostgreSQL and caches like Redis. This approach catches integration failures that mocks miss, ensuring your distributed application functions correctly before production deployment.

Can I test ASP.NET Core APIs against real PostgreSQL and Redis using .NET Aspire?

You can test ASP.NET Core APIs against real PostgreSQL databases and Redis caches managed by .NET Aspire. The framework orchestrates these dependencies, discovers their dynamic endpoints, and uses xUnit fixtures to validate API interactions in a production-like environment.