dotnet-testing-unit-test-fundamentals

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

A beginner’s guide to unit testing in .NET, where small automated checks verify individual parts of a program. It covers the FIRST principles and the arrange-act-assert test structure.

In plain words
What is it for?
It is for learning how to write and structure basic .NET unit tests, including xUnit facts and theories, test isolation, clear checks, and the test pyramid.
Why use it?
New tests can be slow, dependent on one another, difficult to repeat, or unclear when they fail. The guide explains practices that make basic tests reliable and understandable.

Skill for Claude CodeCodex

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

Good fit It is for learning how to write and structure basic .NET unit tests, including xUnit facts and theories, test isolation, clear checks, and the test pyramid.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-unit-test-fundamentals"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-unit-test-fundamentals.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 148 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,710 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.00148 $0.02710
Opus 5.5 $0.00059 $0.01084
Sonnet 5.5 $0.00030 $0.00542
Haiku 4.5 $0.00015 $0.00271

Measured 2mo ago against content hash 53e153f5ea05, 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-unit-test-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-unit-test-fundamentals/SKILL.md · 305 lines

How it starts

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

.NET 單元測試基礎指南

FIRST 原則

好的單元測試遵循以下原則,因為這些原則能確保測試的可靠性與維護性:

F - Fast (快速)

測試執行時間應在毫秒級,不依賴外部資源。

[Fact] // Fast: 不依賴外部資源,執行快速
public void Add_輸入1和2_應回傳3()
{
    // 純記憶體運算,無 I/O 或網路延遲
    var calculator = new Calculator();
    var result = calculator.Add(1, 2);
    Assert.Equal(3, result);
}

I - Independent (獨立)

測試之間不應有相依性,每個測試都建立新的實例。

[Fact] // Independent: 每個測試都建立新的實例
public void Increment_從0開始_應回傳1()
{
    var counter = new Counter(); // 每個測試都建立新的實例,不受其他測試影響
    counter.Increment();
    Assert.Equal(1, counter.Value);
}

R - Repeatable (可重複)

在任何環境都能得到相同結果,不依賴外部狀態。

[Fact] // Repeatable: 每次執行都得到相同結果
public void Increment_多次執行_應產生一致結果()
{
    var counter = new Counter();
    counter.Increment();
    counter.Increment();
    counter.Increment();
    
    // 每次執行這個測試都會得到相同結果
    Assert.Equal(3, counter.Value);
}

S - Self-Validating (自我驗證)

測試結果應為明確的通過或失敗,使用清晰的斷言。

[Fact] // Self-Validating: 明確的驗證
public void IsValidEmail_輸入有效Email_應回傳True()
{
    var emailHelper = new EmailHelper();
    var result = emailHelper.IsValidEmail("[email protected]");
    
    Assert.True(result); // 明確的通過或失敗
}

T - Timely (及時)

測試應在產品程式碼之前或同時撰寫,確保程式碼的可測試性。

3A Pattern 結構

每個測試方法遵循 Arrange-Act-Assert 模式,這種結構讓測試意圖一目了然:

[Fact]
public void Add_輸入負數和正數_應回傳正確結果()
{
    // Arrange - 準備測試資料與相依物件
    var calculator = new Calculator();
    const int a = -5;
    const int b = 3;
    const int expected = -2;

    // Act - 執行被測試的方法
    var result = calculator.Add(a, b);

    // Assert - 驗證結果是否符合預期
    Assert.Equal(expected, result);
}

各區塊職責

區塊 職責 注意事項
Arrange 準備測試所需的物件、資料、Mock 使用 const 宣告常數值,提高可讀性
Act 執行被測試的方法 通常只有一行,呼叫被測方法
Assert 驗證結果 每個測試只驗證一個行為

Read the full file on GitHub · 305 lines

Files

What ships with it

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

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 · +4 lines · -45 tokens per session 53e153f5ea05
  2. 3mo ago First seen · 301 lines · 193 tokens per session scan A 52e52ee421ee

Subscribe to this mod's changes

dotnet-testing-unit-test-fundamentals is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (30 stars, last pushed 1mo ago), licensed MIT. It adds 148 tokens to every session and 2,710 once invoked, about $0.0006 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-unit-test-fundamentals compared with skills from other repositories

dotnet-testing-unit-test-fundamentals next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dotnet-testing-unit-test-fundamentalskevintsengtw/dotnet-testing-agent-skillsSkill301mo agoMITA148Claude 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