dotnet-testing-awesome-assertions-guide

dotnet-testing-awesome-assertions-guide is a skill for Claude Code, Codex from kevintsengtw/dotnet-testing-agent-skills. It costs 191 tokens per session (3,709 once invoked), scanned A, original, MIT.

A guide to AwesomeAssertions, a .NET library for writing readable checks in automated tests. It covers checks for objects, collections, strings, numbers, exceptions, and asynchronous code.

In plain words
What is it for?
Writing assertions with methods such as Should, BeEquivalentTo, Contain, and ThrowAsync, including comparisons of complex objects and collections.
Why use it?
It makes test failures easier to understand and lets developers express expected results in a more natural form.

Skill for Claude CodeCodex

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

Good fit Writing assertions with methods such as Should, BeEquivalentTo, Contain, and ThrowAsync, including comparisons of complex objects and collections.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-awesome-assertions-guide.svg)](https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-awesome-assertions-guide)
Your own site
<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-awesome-assertions-guide"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-awesome-assertions-guide.svg" alt="Measured on agentmods" height="20"></a>
Per session 191 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,709 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.
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.00191 $0.03709
Opus 5 $0.00096 $0.01854
Sonnet 5 $0.00038 $0.00742
Haiku 4.5 $0.00019 $0.00371

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

Security

Grade A, and why

dotnet-testing-awesome-assertions-guide 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 7d 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-awesome-assertions-guide/SKILL.md · 393 lines

How it starts

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

AwesomeAssertions 流暢斷言指南

本技能提供使用 AwesomeAssertions 進行高品質測試斷言的完整指南,涵蓋基礎語法、進階技巧與最佳實踐。

關於 AwesomeAssertions

AwesomeAssertions 是 FluentAssertions 的社群分支版本,使用 Apache 2.0 授權,完全免費且無商業使用限制。

核心特色

  • 完全免費:Apache 2.0 授權,適合商業專案使用
  • 流暢語法:支援方法鏈結的自然語言風格
  • 豐富斷言:涵蓋物件、集合、字串、數值、例外等各種類型
  • 優秀錯誤訊息:提供詳細且易理解的失敗資訊
  • 高性能:優化的實作確保測試執行效率
  • 可擴展:支援自訂 Assertions 方法

與 FluentAssertions 的關係

AwesomeAssertions 是 FluentAssertions 的社群 fork,主要差異:

項目 FluentAssertions AwesomeAssertions
授權 商業專案需付費 Apache 2.0(完全免費)
命名空間 FluentAssertions AwesomeAssertions
API 相容性 原版 高度相容
社群支援 官方維護 社群維護

安裝與設定

NuGet 套件安裝

# .NET CLI
dotnet add package AwesomeAssertions

# Package Manager Console
Install-Package AwesomeAssertions

csproj 設定(推薦)

<ItemGroup>
  <PackageReference Include="AwesomeAssertions" Version="9.4.0" PrivateAssets="all" />
</ItemGroup>

命名空間引用

using AwesomeAssertions;
using Xunit;

核心 Assertions 語法

所有 Assertions 皆以 .Should() 開始,搭配流暢方法鏈結。

類別 常用方法 說明
物件 NotBeNull(), BeOfType<T>(), BeEquivalentTo() 空值、類型、相等性檢查
字串 Contain(), StartWith(), MatchRegex(), BeEquivalentTo() 內容、模式、忽略大小寫比對
數值 BeGreaterThan(), BeInRange(), BeApproximately() 比較、範圍、浮點精度
數值集合 EqualApproximately(), NotEqualApproximately() 數值集合近似比對(9.4+)
集合 HaveCount(), Contain(), BeEquivalentTo(), AllSatisfy() 數量、內容、順序、條件
例外 Throw<T>(), NotThrow(), WithMessage(), WithInnerException() 例外類型、訊息、巢狀例外
非同步 ThrowAsync<T>(), CompleteWithinAsync() 非同步例外與完成驗證

完整語法範例與程式碼請參閱 references/core-assertions-syntax.md


進階技巧:複雜物件比對

使用 BeEquivalentTo() 搭配 options 進行深度物件比較:

Read the full file on GitHub · 393 lines

Files

What ships with it

5 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. 7d ago First seen · 393 lines · 191 tokens per session scan A 5263f29edb60

Subscribe to this mod's changes

dotnet-testing-awesome-assertions-guide is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (28 stars, last pushed 22d ago), licensed MIT. It adds 191 tokens to every session and 3,709 once invoked, about $0.0010 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.

Related

Other skills, from other repositories

inventree-devcontainer-testing

Run the InvenTree Plugin AI Toolkit devcontainer and execute a plugin's test-all.sh. Covers Docker setup, postCreateCommand, server startup, and the lint/unit/integration/frontend-build/E2E layers.

jrobelia/inventree-plugin-ai-toolkit · 49 tokens

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.

Azure/azure-sdk-for-net · 68 tokens

test-quality

Write high-quality JUnit 5 tests with AssertJ assertions. Use when user says "add tests", "write tests", "improve test coverage", or when reviewing/creating test classes for Java code.

decebals/claude-code-java · 45 tokens

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…

managedcode/dotnet-skills · 149 tokens

nunit

Write, run, or repair .NET tests that use NUnit. Use when a repo uses NUnit, [Test], [TestCase], [TestFixture], or NUnit3TestAdapter for VSTest or Microsoft.Testing.Platform execution. USE FOR: writing or reviewing NUnit tests; using [Test], [TestCase], [TestFixture], [SetUp], [TearDown] attributes; configuring…

managedcode/dotnet-skills · 146 tokens

crap-score

Calculates CRAP (Change Risk Anti-Patterns) for a named .NET method, class, or file. USE FOR: explicit CRAP calculation or coverage-and-complexity risk within that named target, including which tests to prioritize. DO NOT USE FOR: project-wide coverage/CRAP, plateaus, or project-wide blockers/priorities…

managedcode/dotnet-skills · 99 tokens