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-tunit-fundamentalsgit 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-tunit-fundamentals)<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-tunit-fundamentals"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-tunit-fundamentals/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-tunit-fundamentals"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-tunit-fundamentals.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.00226 | $0.02244 |
| Opus 5 | $0.00113 | $0.01122 |
| Sonnet 5 | $0.00045 | $0.00449 |
| Haiku 4.5 | $0.00023 | $0.00224 |
Grade A, and why
dotnet-testing-advanced-tunit-fundamentals 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 10d 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 — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TUnit 新世代測試框架入門基礎
TUnit 框架核心特色
1. Source Generator 驅動的測試發現
TUnit 與傳統測試框架最大的差異在於使用 Source Generator 在編譯時期完成測試發現,避免反射成本、完全支援 Native AOT、更快的啟動時間。
// TUnit 在編譯時期就透過 Source Generator 產生測試註冊程式碼
public class ModernTests
{
[Test] // 編譯時期就被處理和最佳化
public async Task TestMethod()
{
await Assert.That(true).IsTrue();
}
}
2. AOT (Ahead-of-Time) 編譯支援
傳統 JIT:C# 原始碼 → IL 中間碼 → 執行時期 JIT 編譯 → 機器碼 → 執行
AOT: C# 原始碼 → 編譯時期直接產生 → 機器碼 → 直接執行
AOT 優勢:超快啟動時間、更小的記憶體占用、可預測的效能、更適合容器化部署。大型專案可達 10-30 倍啟動時間改善。
3. Microsoft.Testing.Platform 採用
TUnit 建構在微軟最新的 Microsoft.Testing.Platform 之上,而非傳統的 VSTest 平台。
重要注意事項: TUnit 專案不需要也不應該安裝 Microsoft.NET.Test.Sdk 套件。
4. 預設並行執行
TUnit 將並行執行設為預設,需要時可用 [NotInParallel("GroupName")] 控制特定測試群組依序執行。
TUnit 專案建立
支援手動建立(console 模板 + TUnit 套件)或使用 TUnit Template(dotnet new tunit,推薦)。專案需設定 csproj(TUnit 套件、IsTestProject)與 GlobalUsings.cs。所有測試方法必須是非同步的(async Task)。
完整專案建立步驟與 csproj 範例請參閱 references/project-setup.md
測試屬性與參數化
基本測試 [Test]
TUnit 統一使用 [Test] 屬性,不像 xUnit 區分 [Fact] 和 [Theory]:
[Test]
public async Task Add_輸入1和2_應回傳3()
{
var calculator = new Calculator();
var result = calculator.Add(1, 2);
await Assert.That(result).IsEqualTo(3);
}
參數化測試 [Arguments]
[Test]
[Arguments(1, 2, 3)]
[Arguments(-1, 1, 0)]
[Arguments(0, 0, 0)]
public async Task Add_多組輸入_應回傳正確結果(int a, int b, int expected)
{
var calculator = new Calculator();
var result = calculator.Add(a, b);
await Assert.That(result).IsEqualTo(expected);
}
TUnit.Assertions 斷言系統
TUnit 採用流暢式(Fluent)斷言設計,所有斷言都是非同步的。支援相等性、布林值、數值比較、字串、集合、例外等多種斷言,並可透過 And / Or 組合條件。
await Assert.That(actual).IsEqualTo(expected);
await Assert.That(email).Contains("@").And.EndsWith(".com");
await Assert.That(() => action()).Throws<InvalidOperationException>();
完整斷言類型與範例請參閱 references/tunit-assertions-detail.md
What ships with it
10 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/lifecycle-management.md 2.3 KB
- references/project-setup.md 2.2 KB
- references/tunit-assertions-detail.md 3.0 KB
- references/xunit-migration.md 3.2 KB
- templates/assertion-examples.cs 6.0 KB
- templates/basic-test-examples.cs 3.4 KB
- templates/GlobalUsings.cs 462 B
- templates/lifecycle-examples.cs 6.3 KB
- templates/tunit-project.csproj 1.2 KB
- templates/xunit-migration-guide.md 7.5 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.
- 10d ago First seen · 177 lines · 226 tokens per session scan A 99922c5c9862
dotnet-testing-advanced-tunit-fundamentals is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (28 stars, last pushed 25d ago), licensed MIT. It adds 226 tokens to every session and 2,244 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-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…
csharp-xunit
Your goal is to help me write effective unit tests with XUnit, covering both standard and data-driven testing approaches.
cratis-specs-csharp
Step-by-step guidance for writing C# specs in Cratis with BDD Specification by Example — the Establish/Because/should pattern, for/when/and folder hierarchy, reusable given/ contexts, NSubstitute mocking, and the in-process scenario family. Use when writing C# unit or integration specs or structuring the for/when/and…
.NET Patterns
Use this skill when working in .NET projects (C#) and you want clean layering, safe async usage, and maintainable dependency injection patterns.
csharp-tunit
Get best practices for TUnit unit testing, including data-driven tests.