dotnet-testing-advanced-tunit-advanced

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

A guide for advanced TUnit testing in .NET. TUnit is a testing framework; the guide covers tests driven by data, dependency injection, integration tests, retries, time limits, and filtering.

In plain words
What is it for?
Building data-driven tests, combining parameter sets, sharing test data, filtering tests by properties, injecting dependencies, and running integration tests with WebApplicationFactory or Testcontainers.
Why use it?
It helps developers choose and configure advanced testing patterns when simple one-input unit tests are not enough.

Skill for Claude CodeCodex

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

Good fit Building data-driven tests, combining parameter sets, sharing test data, filtering tests by properties, injecting dependencies, and running integration tests with WebApplicationFactory or Testcontainers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-tunit-advanced
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-advanced
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-advanced

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-tunit-advanced"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-advanced-tunit-advanced.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 211 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,275 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.00211 $0.04275
Opus 5 $0.00105 $0.02138
Sonnet 5 $0.00042 $0.00855
Haiku 4.5 $0.00021 $0.00428

Measured 9d ago against content hash bafa2ee1678c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

dotnet-testing-advanced-tunit-advanced 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.

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

How it starts

The opening of the file, as written. The whole thing — 428 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TUnit 進階應用:資料驅動測試、依賴注入與整合測試實戰

資料驅動測試進階技巧

TUnit 提供 MethodDataSource、ClassDataSource、Matrix Tests 三種進階資料來源。MethodDataSource 最靈活,支援動態產生與外部檔案載入;ClassDataSource 適合跨測試類別共享資料與 AutoFixture 整合;Matrix Tests 自動產生所有參數組合(注意控制數量避免爆炸性增長)。

完整範例與比較表請參閱 references/data-driven-testing.md


Properties 屬性標記與測試過濾

基本 Properties 使用

[Test]
[Property("Category", "Database")]
[Property("Priority", "High")]
public async Task DatabaseTest_高優先級_應能透過屬性過濾()
{
    await Assert.That(true).IsTrue();
}

[Test]
[Property("Category", "Unit")]
[Property("Priority", "Medium")]
public async Task UnitTest_中等優先級_基本驗證()
{
    await Assert.That(1 + 1).IsEqualTo(2);
}

[Test]
[Property("Category", "Integration")]
[Property("Priority", "Low")]
[Property("Environment", "Development")]
public async Task IntegrationTest_低優先級_僅開發環境執行()
{
    await Assert.That("Hello World").Contains("World");
}

建立一致的屬性命名規範

public static class TestProperties
{
    // 測試類別
    public const string CATEGORY_UNIT = "Unit";
    public const string CATEGORY_INTEGRATION = "Integration";
    public const string CATEGORY_E2E = "E2E";

    // 優先級
    public const string PRIORITY_CRITICAL = "Critical";
    public const string PRIORITY_HIGH = "High";
    public const string PRIORITY_MEDIUM = "Medium";
    public const string PRIORITY_LOW = "Low";

    // 環境
    public const string ENV_DEVELOPMENT = "Development";
    public const string ENV_STAGING = "Staging";
    public const string ENV_PRODUCTION = "Production";
}

[Test]
[Property("Category", TestProperties.CATEGORY_UNIT)]
[Property("Priority", TestProperties.PRIORITY_HIGH)]
public async Task ExampleTest_使用常數_確保一致性()
{
    await Assert.That(1 + 1).IsEqualTo(2);
}

TUnit 測試過濾執行

TUnit 使用 dotnet run 而不是 dotnet test

# 只執行單元測試
dotnet run --treenode-filter "/*/*/*/*[Category=Unit]"

# 只執行高優先級測試
dotnet run --treenode-filter "/*/*/*/*[Priority=High]"

# 組合條件:執行高優先級的單元測試
dotnet run --treenode-filter "/*/*/*/*[(Category=Unit)&(Priority=High)]"

# 或條件:執行單元測試或冒煙測試
dotnet run --treenode-filter "/*/*/*/*[(Category=Unit)|(Suite=Smoke)]"

# 執行特定功能的測試
dotnet run --treenode-filter "/*/*/*/*[Feature=OrderProcessing]"

Read the full file on GitHub · 428 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. 9d ago First seen · 428 lines · 211 tokens per session scan A bafa2ee1678c

Subscribe to this mod's changes

dotnet-testing-advanced-tunit-advanced is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (28 stars, last pushed 24d ago), licensed MIT. It adds 211 tokens to every session and 4,275 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.