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.
npx agentmods add skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-autofixture-customizationnpx skills add kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-autofixture-customizationgit clone --depth 1 https://github.com/kevintsengtw/dotnet-testing-agent-skillsWrote 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.
[](https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-autofixture-customization)<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-autofixture-customization"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-autofixture-customization.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00211 | $0.01906 |
| Opus 5 | $0.00105 | $0.00953 |
| Sonnet 5 | $0.00042 | $0.00381 |
| Haiku 4.5 | $0.00021 | $0.00191 |
Grade A, and why
dotnet-testing-autofixture-customization 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AutoFixture 進階:自訂化測試資料生成策略
概述
本技能涵蓋 AutoFixture 的進階自訂化功能,讓您能根據業務需求精確控制測試資料的生成邏輯。
核心技術
- DataAnnotations 整合:AutoFixture 自動識別
[StringLength]、[Range]等驗證屬性 - 屬性範圍控制:使用
.With()配合Random.Shared動態產生隨機值 - 自訂 ISpecimenBuilder:實作精確控制特定屬性的建構器
- 優先順序管理:理解
Insert(0)vsAdd()的差異 - 泛型化設計:建立支援多種數值型別的可重用建構器
安裝套件
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="AutoFixture.Xunit2" Version="4.18.1" />
DataAnnotations 自動整合
AutoFixture 能自動識別 System.ComponentModel.DataAnnotations 的驗證屬性:
public class Person
{
public Guid Id { get; set; }
[StringLength(10)]
public string Name { get; set; } = string.Empty;
[Range(10, 80)]
public int Age { get; set; }
public DateTime CreateTime { get; set; }
}
[Fact]
public void AutoFixture_應能識別DataAnnotations()
{
var fixture = new Fixture();
var person = fixture.Create<Person>();
person.Name.Length.Should().Be(10); // StringLength(10)
person.Age.Should().BeInRange(10, 80); // Range(10, 80)
}
使用 .With() 控制屬性範圍
固定值 vs 動態值
// ❌ 固定值:只執行一次,所有物件相同值
.With(x => x.Age, Random.Shared.Next(30, 50))
// ✅ 動態值:每個物件都重新計算
.With(x => x.Age, () => Random.Shared.Next(30, 50))
Random.Shared 的優點
| 特性 | new Random() |
Random.Shared |
|---|---|---|
| 實例化方式 | 每次建立新實例 | 全域共用單一實例 |
| 執行緒安全 | 不是 | 是 |
| 效能 | 多次建立有負擔,可能重複值 | 效能更佳,避免重複值 |
自訂 ISpecimenBuilder
涵蓋 RandomRangedDateTimeBuilder(精確控制特定 DateTime 屬性)、ImprovedRandomRangedNumericSequenceBuilder(改進版數值範圍建構器)、泛型化 NumericRangeBuilder<TValue>(支援 int/long/decimal/double/float 等多種型別),以及流暢介面擴充方法 AddRandomRange。每個建構器皆附完整實作與使用範例。
完整 ISpecimenBuilder 實作範例請參考 references/specimen-builder-examples.md
優先順序管理:Insert(0) vs Add()
AutoFixture 內建的 RangeAttributeRelay、NumericSequenceGenerator 可能比自訂建構器有更高優先順序:
What ships with it
4 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.
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.
- 6d ago First seen · 151 lines · 211 tokens per session scan A c1376582306d
dotnet-testing-autofixture-customization is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (28 stars, last pushed 21d ago), licensed MIT. It adds 211 tokens to every session and 1,906 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.
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.
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…
csharp-xunit
Your goal is to help me write effective unit tests with XUnit, covering both standard and data-driven testing approaches.
cratis-specs-csharp
Step-by-step guidance for writing C# specs in Cratis with BDD Specification by Example — the Establish/Because/should pattern, for/when/and folder hierarchy, reusable given/ contexts, NSubstitute mocking, and the in-process scenario family. Use when writing C# unit or integration specs or structuring the for/when/and…
.NET Patterns
Use this skill when working in .NET projects (C#) and you want clean layering, safe async usage, and maintainable dependency injection patterns.
csharp-tunit
Get best practices for TUnit unit testing, including data-driven tests.