dotnet-testing-advanced-tunit-fundamentals

dotnet-testing-advanced-tunit-fundamentals is a skill for Claude Code, Codex from kevintsengtw/dotnet-testing-agent-skills. It costs 181 tokens per session (2,588 once invoked), scanned A, original, MIT.

A guide to using TUnit, a testing framework for .NET applications. It covers creating tests, moving from xUnit, and running tests with compile-time discovery and ahead-of-time compilation.

In plain words
What is it for?
Use it to create a TUnit test project, write basic or parameterized tests, manage setup and cleanup, control parallel execution, or migrate xUnit tests.
Why use it?
It explains the setup and syntax differences that can make adopting TUnit or leaving xUnit confusing. It also covers test lifecycles, asynchronous checks, and controlling tests that run at the same time.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create a TUnit test project, write basic or parameterized tests, manage setup and cleanup, control parallel execution, or migrate xUnit tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-tunit-fundamentals
Install

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.

Any agent
npx skills add kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-advanced-tunit-fundamentals
Clone the repo
git clone --depth 1 https://github.com/kevintsengtw/dotnet-testing-agent-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for dotnet-testing-advanced-tunit-fundamentals

README.md
[![agentmods](https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-tunit-fundamentals/github.svg)](https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-tunit-fundamentals)
Your own site
<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.

agentmods 80×15 button for dotnet-testing-advanced-tunit-fundamentals

Your own site · 80×15
<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>
Per session 181 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,588 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00181 $0.02588
Opus 5.5 $0.00072 $0.01035
Sonnet 5.5 $0.00036 $0.00518
Haiku 4.5 $0.00018 $0.00259

Measured 2mo ago against content hash 8934b7d4406a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo 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.

skills/dotnet-testing-advanced-tunit-fundamentals/SKILL.md · 190 lines

How it starts

The opening of the file, as written. The whole thing — 190 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);
}

decimal 不是 attribute 常數型別,[Arguments(1.5m)] 會編譯失敗(CS0182)。 TUnit 0.60.15 起會把 double 或 string 常值自動轉成 decimal 參數:參數宣告為 decimal, 寫 [Arguments(1.5)] 或 [Arguments("19.99")] 即可。更早的版本不支援這個轉換, 請改用 [MethodDataSource] 提供 decimal 值。

TUnit.Assertions 斷言系統

TUnit 採用流暢式(Fluent)斷言設計,所有斷言都是非同步的。支援相等性、布林值、數值比較、字串、集合、例外等多種斷言,並可透過 And / Or 組合條件。

Read the full file on GitHub · 190 lines

Changes

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.

  1. 2mo ago Changed · +13 lines · -45 tokens per session 8934b7d4406a
  2. 3mo ago First seen · 177 lines · 226 tokens per session scan A 99922c5c9862

Subscribe to this mod's changes

dotnet-testing-advanced-tunit-fundamentals is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (30 stars, last pushed 1mo ago), licensed MIT. It adds 181 tokens to every session and 2,588 once invoked, about $0.0007 per session on Opus 5.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.

Related

dotnet-testing-advanced-tunit-fundamentals compared with skills from other repositories

dotnet-testing-advanced-tunit-fundamentals next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dotnet-testing-advanced-tunit-fundamentalskevintsengtw/dotnet-testing-agent-skillsSkill301mo agoMITA181Claude Code, Codex
author-testAzure/azure-sdk-for-netSkill6.1ktodayMITA68Claude Code, Codex
migrate-xunit-to-xunit-v3managedcode/dotnet-skillsSkill52716d agoMITA149Claude Code, Codex
clean-architecture-dotnetSebastienDegodez/copilot-instructionsSkill19924d agoApache-2.0A50Claude Code, Codex
creating-dotnet-mcp-serversSebastienDegodez/copilot-instructionsSkill19924d agoApache-2.0A43Claude Code, Codex
csharp-xunitPracticalSwan/agent-skillsSkill2515d agoMITA25Codex
cratis-specifications-isolate-behaviorCratis/AISkill4todayMITA46Claude Code, Codex