·dotnet-testing-autofixture-nsubstitute-integration
</>

dotnet-testing-autofixture-nsubstitute-integration

kevintsengtw/dotnet-testing-agent-skills

AutoFixture 與 NSubstitute 整合指南 - 實現自動模擬 (Auto-Mocking)。 涵蓋 AutoNSubstituteDataAttribute、Frozen 機制、Greedy 建構策略。 包含 IMapper (AutoMapper/Mapster) 等特殊相依性的客製化處理。 適用於複雜相依性注入測試、Mock 驗證與行為設定。

12Installs·0Trend·@kevintsengtw

Installation

$npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-autofixture-nsubstitute-integration

SKILL.md

本技能介紹如何整合 AutoFixture 與 NSubstitute,透過 AutoFixture.AutoNSubstitute 套件實現自動模擬(Auto-Mocking)功能。這種整合方式可以大幅簡化具有多個相依性的服務類別測試,讓開發者專注於測試邏輯本身,而非繁瑣的物件建立過程。

| AutoFixture.AutoNSubstitute | AutoFixture 與 NSubstitute 整合 | nuget.org | | AutoFixture.Xunit2 | xUnit 整合(AutoData 屬性) | nuget.org | | NSubstitute | 模擬框架 | nuget.org |

| 服務層測試 | 通常有多個相依性,自動模擬效益最大 | | 複雜相依圖 | AutoFixture 自動處理多層相依性 | | 參數化測試 | 結合固定值與自動產生資料 | | 需要大量測試資料 | 減少手動建立測試資料的工作 | | 快速迭代開發 | 建構函式變更時測試通常不需修改 |

AutoFixture 與 NSubstitute 整合指南 - 實現自動模擬 (Auto-Mocking)。 涵蓋 AutoNSubstituteDataAttribute、Frozen 機制、Greedy 建構策略。 包含 IMapper (AutoMapper/Mapster) 等特殊相依性的客製化處理。 適用於複雜相依性注入測試、Mock 驗證與行為設定。 Source: kevintsengtw/dotnet-testing-agent-skills.

View raw

Facts (cite-ready)

Stable fields and commands for AI/search citations.

Install command
npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-autofixture-nsubstitute-integration
Category
</>Dev Tools
Verified
First Seen
2026-02-01
Updated
2026-02-18

Quick answers

What is dotnet-testing-autofixture-nsubstitute-integration?

AutoFixture 與 NSubstitute 整合指南 - 實現自動模擬 (Auto-Mocking)。 涵蓋 AutoNSubstituteDataAttribute、Frozen 機制、Greedy 建構策略。 包含 IMapper (AutoMapper/Mapster) 等特殊相依性的客製化處理。 適用於複雜相依性注入測試、Mock 驗證與行為設定。 Source: kevintsengtw/dotnet-testing-agent-skills.

How do I install dotnet-testing-autofixture-nsubstitute-integration?

Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-autofixture-nsubstitute-integration Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code or Cursor

Where is the source repository?

https://github.com/kevintsengtw/dotnet-testing-agent-skills