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 150 tokens per session (3,667 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/github.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/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-awesome-assertions-guide

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,667 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.00150 $0.03667
Opus 5.5 $0.00060 $0.01467
Sonnet 5.5 $0.00030 $0.00733
Haiku 4.5 $0.00015 $0.00367

Measured 22d ago against content hash 0f5f9e2da5d5, 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-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 22d 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 · 392 lines

How it starts

The opening of the file, as written. The whole thing — 392 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 · 392 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. 22d ago Changed · -1 lines · -41 tokens per session 0f5f9e2da5d5
  2. 1mo 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 (30 stars, last pushed 18d ago), licensed MIT. It adds 150 tokens to every session and 3,667 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

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.

Azure/azure-sdk-for-net · 68 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

csharp-xunit

Your goal is to help me write effective unit tests with XUnit, covering both standard and data-driven testing approaches.

PracticalSwan/agent-skills · 25 tokens

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

migrate-nunit-to-mstest

Convert .NET tests from NUnit 3/4 to MSTest v4 while preserving VSTest or MTP. Use for replacing NUnit/NUnit3TestAdapter packages, Test/TestCase/ TestCaseSource/Values attributes, constraint assertions, SetUp/TearDown, OneTimeSetUp, SetUpFixture, FixtureLifeCycle, TestContext, categories, retries, timeouts, and NUnit…

managedcode/dotnet-skills · 144 tokens

csharp-tunit

Get best practices for TUnit unit testing, including data-driven tests.

MarieLynneBlock/arcanum-artifex · 18 tokens