Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-testcontainers-databasenpx skills add kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-advanced-testcontainers-databasegit clone --depth 1 https://github.com/kevintsengtw/dotnet-testing-agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-testcontainers-database)<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-testcontainers-database"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-testcontainers-database.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00199 | $0.02553 |
| Opus 5 | $0.00100 | $0.01277 |
| Sonnet 5 | $0.00040 | $0.00511 |
| Haiku 4.5 | $0.00020 | $0.00255 |
Grade A, and why
dotnet-testing-advanced-testcontainers-database scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testcontainers 資料庫整合測試指南
EF Core InMemory 的限制
在選擇測試策略前,必須了解 EF Core InMemory 資料庫的重大限制:
1. 交易行為與資料庫鎖定
- 不支援資料庫交易 (Transactions):
SaveChanges()後資料立即儲存,無法進行 Rollback - 無資料庫鎖定機制:無法模擬並發 (Concurrency) 情境下的行為
2. LINQ 查詢差異
- 查詢翻譯差異:某些 LINQ 查詢(複雜 GroupBy、JOIN、自訂函數)在 InMemory 中可執行,但轉換成 SQL 時可能失敗
- Case Sensitivity:InMemory 預設不區分大小寫,但真實資料庫依賴校對規則 (Collation)
- 效能模擬不足:無法模擬真實資料庫的效能瓶頸或索引問題
3. 資料庫特定功能
InMemory 模式無法測試:預存程序、Triggers、Views、外鍵約束、檢查約束、資料類型精確度、Concurrency Tokens 等。
結論:當需要驗證複雜交易邏輯、並發處理、資料庫特定行為時,應使用 Testcontainers 進行整合測試。
Testcontainers 核心概念
Testcontainers 是一個測試函式庫,提供輕量好用的 API 來啟動 Docker 容器,專門用於整合測試。
核心優勢
- 真實環境測試:使用真實資料庫,測試實際 SQL 語法與資料庫限制
- 環境一致性:確保測試環境與正式環境使用相同服務版本
- 清潔測試環境:每個測試有獨立乾淨的環境,容器自動清理
- 簡化開發環境:開發者只需 Docker,不需安裝各種服務
必要套件
<ItemGroup>
<!-- 測試框架 -->
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageReference Include="AwesomeAssertions" Version="9.4.0" />
<!-- Testcontainers 核心套件 -->
<PackageReference Include="Testcontainers" Version="4.11.0" />
<!-- 資料庫容器 -->
<PackageReference Include="Testcontainers.PostgreSql" Version="4.11.0" />
<PackageReference Include="Testcontainers.MsSql" Version="4.11.0" />
<!-- Entity Framework Core -->
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0" />
<!-- Dapper (可選) -->
<PackageReference Include="Dapper" Version="2.1.72" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0" />
</ItemGroup>
重要:使用
Microsoft.Data.SqlClient而非舊版System.Data.SqlClient,提供更好的效能與安全性。
環境需求
- Windows 10 版本 2004+,啟用 WSL 2,8GB RAM(建議 16GB+),64GB 磁碟空間
- Docker Desktop 建議設定:Memory 6GB、CPUs 4 cores、Swap 2GB、Disk 64GB
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/collection-fixture-and-scripts.md 4.0 KB
- references/container-basics.md 1.9 KB
- references/orm-advanced-testing.md 4.4 KB
- templates/dapper-integration-tests.cs 18 KB
- templates/mssql-collection-fixture.cs 13 KB
- templates/postgresql-container-fixture.cs 5.9 KB
- templates/test-project.csproj 2.4 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 181 lines · 199 tokens per session scan A 77991bf44e70
dotnet-testing-advanced-testcontainers-database is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (28 stars, last pushed 21d ago), licensed MIT. It adds 199 tokens to every session and 2,553 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
infra-conventions
Infrastructure and deployment conventions. Auto-injected into devops-aware agents - not user-invocable.
706-technologies-containers-docker
Use when you need framework-agnostic Docker and container image guidance for Java projects - Dockerfile design, multi-stage Maven builds, jlink custom runtimes, micro runtime distributions such as Alpaquita, JVM container ergonomics, non-root execution, image metadata, .dockerignore, reproducible builds, vulnerability…
aspire-stop
Stop the .NET Aspire AppHost and its Docker containers via the developer CLI. Defaults to the current worktree; supports stopping all worktrees or a specific base port.
clean-architecture-dotnet
Use when domain logic leaks into API/Infrastructure, project references violate layer boundaries, or you need to decide between CQS (always), CQRS bus (complex domains), and DDD patterns (invariants and events).
mutation-testing
Use when running mutation testing, killing mutants, verifying test quality, checking mutation score, or analyzing survivors after the test baseline is green.
generate-microcks-openapi-samples
Use when creating OpenAPI mock examples for Microcks, setting up request/response routing with dispatchers, or mapping request fields to mock responses.