dotnet-testing-advanced-aspire-testing

Guide .NET Aspire integration testing with container lifecycle and PostgreSQL setup.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-testing-advanced-aspire-testing-rudironsoni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-testing-advanced-aspire-testing
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-testing-advanced-aspire-testing
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-testing-advanced-aspire-testing-rudironsoni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to integrating .NET Aspire's testing framework into your distributed applications, simplifying complex integration testing scenarios.

Core Features & Use Cases

  • Aspire Testing Framework: Learn to configure and utilize the DistributedApplicationTestingBuilder for robust integration tests.
  • Container Orchestration: Understand how Aspire manages container lifecycles for databases, APIs, and other services within your tests.
  • Use Case: You need to ensure your microservices, including a PostgreSQL database and a Redis cache, communicate correctly within a .NET Aspire application before deploying to production. This Skill guides you through setting up the necessary integration tests.

Quick Start

Use the dotnet-testing-advanced-aspire-testing skill to create integration tests for a .NET Aspire distributed application.

Frequently Asked Questions about dotnet-testing-advanced-aspire-testing

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

FAQPage Schema
How do I set up integration testing for a .NET Aspire distributed application?

To set up .NET Aspire integration testing, configure the DistributedApplicationTestingBuilder to manage your AppHost, orchestrate container lifecycles, and verify service readiness across microservices. This framework simplifies testing distributed applications by handling container infrastructure dependencies automatically.

What is the best way to manage container lifecycles during .NET Aspire tests?

Use ContainerLifetime.Session to manage container lifecycles during .NET Aspire tests. This approach ensures that containers for databases and APIs persist appropriately across test sessions, providing reliable service availability while preventing resource conflicts during integration testing.

Why am I getting endpoint conflicts when running .NET Aspire integration tests?

Endpoint conflicts in .NET Aspire integration tests typically occur due to port allocation collisions between concurrently running test sessions. Implementing proper collection fixtures and configuring container lifecycles resolves these conflicts by isolating network resources across distributed application test runs.

How do I configure Respawner for a PostgreSQL database in .NET Aspire testing?

Configure Respawner for PostgreSQL in .NET Aspire testing by initializing the database within your test setup and applying the Respawn configuration to reset data states between test executions. This ensures clean database initialization without manual teardown across distributed application test runs.

How does Dapper field mapping affect .NET Aspire integration tests?

Dapper field mapping issues in .NET Aspire integration tests usually stem from schema mismatches or missing column mappings during database initialization. Correcting these mappings ensures your microservices retrieve and validate data accurately during distributed application readiness checks.

Can I use collection fixtures to improve .NET Aspire test time reliability?

Yes, you can use collection fixtures to improve .NET Aspire test time reliability by sharing the DistributedApplicationTestingBuilder context across multiple test classes. This reduces container startup overhead and ensures consistent time testability for distributed application integration tests.