aspire-integration-testing

Write xUnit integration tests for .NET Aspire applications with real dependencies.

Updated Dec 4, 2022
One-click install
npx skills add https://github.com/devingoble/CloudOStat --skill aspire-integration-testing-devingoble
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aspire-integration-testing
Source: https://github.com/devingoble/CloudOStat/tree/main/.github/skills/aspire-integration-testing
Command: npx skills add https://github.com/devingoble/CloudOStat --skill aspire-integration-testing-devingoble

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing robust integration tests for .NET Aspire applications, ensuring your distributed systems function correctly with real dependencies.

Core Features & Use Cases

  • Real Dependency Testing: Test against actual databases, caches, and message queues orchestrated by Aspire.
  • Dynamic Endpoint Discovery: Automatically find and use service endpoints without hardcoding URLs.
  • Fixture Management: Efficiently set up and tear down distributed application environments for tests.
  • Use Case: You've built a microservice architecture with .NET Aspire and need to verify that your API correctly interacts with a PostgreSQL database and a Redis cache under realistic conditions.

Quick Start

Use the aspire-integration-testing skill to write integration tests for your .NET Aspire application, ensuring all services and dependencies are correctly configured and communicating.

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 apps using xUnit?

To write integration tests for .NET Aspire apps, you use xUnit with IAsyncLifetime to set up test fixtures, orchestrate the distributed application, and verify service health against real dependencies like SQL Server and Redis.

How do I test distributed systems with real dependencies in .NET Aspire?

Testing distributed systems with real dependencies in .NET Aspire involves orchestrating actual databases and caches within your test environment, verifying that your APIs interact correctly with infrastructure under realistic conditions.

Can I use dynamic endpoint discovery for integration testing in .NET Aspire?

Yes, .NET Aspire supports dynamic endpoint discovery for integration testing, allowing you to automatically locate and use service endpoints without hardcoding URLs, which streamlines test fixture management.

How do I manage test fixture setup and teardown for .NET Aspire distributed applications?

You manage test fixture setup and teardown for .NET Aspire distributed applications by implementing IAsyncLifetime, which efficiently initializes and disposes of your distributed application environments during test execution.

Does .NET Aspire integration testing support checking service health for microservices?

Yes, .NET Aspire integration testing supports service health checks, ensuring your microservice architecture components are fully initialized and communicating correctly before test assertions run.

What is the best way to test an ASP.NET Core API with actual infrastructure like Redis and SQL Server?

The best way to test an ASP.NET Core API with actual infrastructure like Redis and SQL Server is using .NET Aspire to orchestrate real dependencies, enabling dynamic endpoint discovery and robust fixture management.