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 skills add kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-advanced-aspnet-integration-testinggit 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-aspnet-integration-testing)<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-aspnet-integration-testing"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-aspnet-integration-testing/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-aspnet-integration-testing"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-aspnet-integration-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00210 | $0.02776 |
| Opus 5 | $0.00105 | $0.01388 |
| Sonnet 5 | $0.00042 | $0.00555 |
| Haiku 4.5 | $0.00021 | $0.00278 |
Grade A, and why
dotnet-testing-advanced-aspnet-integration-testing 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 9d 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 — 213 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ASP.NET Core 整合測試指南
核心概念
整合測試的兩種定義
- 多物件協作測試 — 將兩個以上的類別做整合,測試它們之間的運作是否正確
- 外部資源整合測試 — 使用到資料庫、外部服務、檔案等外部資源的測試
為什麼需要整合測試?
- 確保多個模組整合後能正確工作
- 單元測試無法涵蓋的整合點:Routing、Middleware、Request/Response Pipeline
- 確認 WebApplication 的整合與設定是否正確
- 確認異常處理是否完善
測試金字塔定位
| 測試類型 | 測試範圍 | 執行速度 | 維護成本 | 建議比例 |
|---|---|---|---|---|
| 單元測試 | 單一類別/方法 | 很快 | 低 | 70% |
| 整合測試 | 多個元件 | 中等 | 中等 | 20% |
| 端對端測試 | 完整流程 | 慢 | 高 | 10% |
原則一:使用 WebApplicationFactory 建立測試環境
透過 WebApplicationFactory<Program> 建立記憶體中的 TestServer,搭配 IClassFixture 在測試類別間共享。
基本流程
- 測試類別實作
IClassFixture<WebApplicationFactory<Program>> - 透過建構函式注入 Factory
- 使用
factory.CreateClient()建立 HttpClient - 對 API 端點發送請求並驗證回應
自訂 Factory
繼承 WebApplicationFactory<Program> 並覆寫 ConfigureWebHost:
- 移除原本的
DbContextOptions,改用UseInMemoryDatabase - 使用
services.Replace()替換外部服務為測試版本 - 設定
builder.UseEnvironment("Testing")使用測試環境
測試基底類別
建立 IntegrationTestBase 封裝共用邏輯:
- Factory 與 HttpClient 初始化
SeedShipperAsync()等資料準備方法CleanupDatabaseAsync()清理方法- 實作
IDisposable確保資源釋放
完整程式碼範例(基本使用、自訂 Factory、測試基底類別)請參考 references/webapplicationfactory-examples.md
原則二:使用 AwesomeAssertions.Web 驗證 HTTP 回應
提供流暢的 HTTP 狀態碼斷言與強型別回應驗證:
- 狀態碼斷言:
Be200Ok()、Be201Created()、Be400BadRequest()、Be404NotFound()等 - Satisfy 驗證:
response.Should().Be200Ok().And.Satisfy<T>(result => { ... }) - 優勢:取代手動
ReadAsStringAsync()+JsonSerializer.Deserialize<T>()的冗長程式碼
原則三:使用 System.Net.Http.Json 簡化 JSON 操作
PostAsJsonAsync(url, object)— 取代手動JsonSerializer.Serialize+new StringContentReadFromJsonAsync<T>()— 取代手動ReadAsStringAsync+JsonSerializer.Deserialize
完整斷言與 JSON 操作範例請參考 references/assertion-and-json-examples.md
三個層級的整合測試策略
What ships with it
8 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/assertion-and-json-examples.md 2.9 KB
- references/crud-test-examples.md 3.2 KB
- references/three-level-testing-strategy.md 3.0 KB
- references/webapplicationfactory-examples.md 2.6 KB
- templates/custom-webapplication-factory.cs 5.9 KB
- templates/http-assertion-examples.cs 8.6 KB
- templates/integration-test-base.cs 7.8 KB
- templates/integration-test-project.csproj 3.2 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.
- 9d ago First seen · 213 lines · 210 tokens per session scan A d197d0a1be98
dotnet-testing-advanced-aspnet-integration-testing is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (28 stars, last pushed 23d ago), licensed MIT. It adds 210 tokens to every session and 2,776 once invoked, about $0.0011 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
author-test
Generate a test given sample. Parameters: C# SDK repository root; Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; the sample to use as a starting point for the test.
migrate-mstest-v3-to-v4
Use this skill before answering, planning, or editing any MSTest 3.x-to-4.x upgrade or post-upgrade failure. Triggers include "MSTest v4 breaking changes"; CS0507/CS0103/CS1061/CS1615; ExecuteAsync, CallerInfo, DisplayName, or custom TestMethodAttribute; ClassCleanupBehavior; ContainsKey; ThrowsExactly or…
migrate-xunit-to-mstest
Convert .NET tests from xUnit.net v2/v3 to MSTest v4 while preserving VSTest or MTP. Use for replacing xunit packages, Fact/Theory/InlineData/MemberData, assertions, IClassFixture/ICollectionFixture, ITestOutputHelper, TestContext cancellation, traits/Owner, skips, timeouts, and xUnit parallelization. Also use when a…
migrate-xunit-to-xunit-v3
Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…
aspire-integration-testing
Write integration tests using .NET Aspire's testing facilities with xUnit. Covers test fixtures, distributed application setup, endpoint discovery, and patterns for testing ASP.NET Core apps with real dependencies.
archunitnet
Use the open-source free ArchUnitNET library for architecture rules in .NET tests. Use when a repo needs richer architecture assertions than lightweight fluent rule libraries usually provide. USE FOR: the repo uses or wants ArchUnitNET; architecture testing needs richer modeling than simple dependency checks. DO NOT…