testcontainers-integration-tests

Create .NET integration tests with TestContainers and xUnit for Docker-based infrastructure.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables writing robust integration tests by leveraging real infrastructure components like databases, message queues, and caches within Docker containers, eliminating the unreliability of mocks.

Core Features & Use Cases

  • Real Infrastructure Testing: Test your application's interaction with actual databases (SQL Server, PostgreSQL), message brokers (RabbitMQ), and caches (Redis).
  • Deterministic & Reliable Tests: Ensure your integration points work as expected in production-like environments.
  • Use Case: Verify that your data access layer correctly inserts, queries, and updates records in a real PostgreSQL database spun up in a Docker container for each test run.

Quick Start

Use the testcontainers-integration-tests skill to write integration tests for your .NET application using TestContainers and xUnit.

Frequently Asked Questions about testcontainers-integration-tests

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

FAQPage Schema
How do I write integration tests for .NET using real databases instead of mocks?

Write integration tests for .NET using real databases by spinning up Docker containers with TestContainers and xUnit. This approach replaces unreliable mocks with actual infrastructure components like SQL Server and PostgreSQL to ensure production-like behavior.

Can I test RabbitMQ and Redis interactions in Docker containers using xUnit?

Yes, you can test RabbitMQ and Redis interactions in Docker containers using xUnit. The Skill facilitates creating integration tests that verify application interactions with these actual message brokers and caches within containerized environments.

What is the best way to achieve deterministic infrastructure testing in .NET?

Deterministic infrastructure testing in .NET is achieved by replacing mocks with actual services spun up in Docker containers. Using TestContainers with xUnit ensures your data access layers and integration points work reliably in production-like environments.

Does TestContainers support running PostgreSQL databases for .NET integration tests?

TestContainers supports running PostgreSQL databases for .NET integration tests. It allows you to dynamically provision real PostgreSQL instances within Docker containers to verify that your data access layer correctly inserts, queries, and updates records.

Why should I replace mocks with real Docker containers for integration testing?

Replace mocks with real Docker containers for integration testing to eliminate unreliability and ensure deterministic test results. Testing against actual infrastructure components like SQL Server, PostgreSQL, Redis, and RabbitMQ guarantees your application behaves as expected in production.

How do I set up integration tests for a .NET data access layer with TestContainers?

Set up integration tests for a .NET data access layer using TestContainers to provision a real database in a Docker container for each test run. This verifies that records are correctly inserted, queried, and updated against the actual service.