dotnet-testing-advanced-testcontainers-database

Run .NET integration tests against SQL Server and PostgreSQL containers via Testcontainers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of setting up and managing real database environments for .NET integration tests, ensuring your data access code functions correctly against actual SQL Server or PostgreSQL instances.

Core Features & Use Cases

  • Real Database Testing: Test EF Core or Dapper against live SQL Server/PostgreSQL containers.
  • Container Management: Automates the startup, configuration, and cleanup of Docker database containers.
  • Efficient Test Execution: Utilizes the Collection Fixture pattern to share container instances across multiple test classes, significantly reducing test run times.
  • SQL Script Integration: Supports externalizing and executing SQL scripts for schema setup and data seeding.

Quick Start

Configure your .NET project to use Testcontainers for SQL Server integration testing by adding the necessary NuGet packages and implementing the IAsyncLifetime interface.

Frequently Asked Questions about dotnet-testing-advanced-testcontainers-database

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

FAQPage Schema
How do I test EF Core against a real database instead of an in-memory provider?

You can test EF Core against a real database by using Testcontainers to spin up actual SQL Server or PostgreSQL instances within Docker. This approach validates your data access layer against live database behavior rather than simulating it with an in-memory provider.

What is the best way to speed up .NET integration tests that use Docker database containers?

The best way to speed up .NET integration tests is to use the Collection Fixture pattern to share a single Testcontainers database instance across multiple test classes. This significantly reduces test run times by avoiding the overhead of starting a new container for each test.

Can I use Testcontainers to test Dapper data access layers in .NET?

Yes, you can use Testcontainers to test Dapper data access layers in .NET. The Skill supports spinning up real SQL Server and PostgreSQL database instances within Docker, allowing you to validate both EF Core and Dapper implementations against live databases.

Do I need Docker to run .NET integration tests with Testcontainers?

Yes, you need Docker to run .NET integration tests with Testcontainers. The framework automates the startup, configuration, and cleanup of database containers, which requires a Docker environment to provision and manage the real SQL Server or PostgreSQL instances.

How do I execute SQL scripts for schema setup when integration testing a .NET database?

You can execute SQL scripts for schema setup and data seeding by integrating external SQL scripts into your test lifecycle. The Skill supports running these scripts against the Testcontainers database instance to prepare your testing environment.