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

dotnet-testing-autofixture-nsubstitute-integration

kevintsengtw/dotnet-testing-agent-skills

AutoFixture 與 NSubstitute 集成指南 - 實現自動模擬 (Auto-Mocking)。 內容 AutoNSubstituteDataAttribute、凍結機制、貪婪策略當前。 包含IMapper (AutoMapper/Mapster)等特殊相依性的客制化處理。 適用於復雜相依性注入測試、模擬驗證與行為設定。

12安裝·0熱度·@kevintsengtw

安裝

$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、凍結機制、貪婪策略當前。 包含IMapper (AutoMapper/Mapster)等特殊相依性的客制化處理。 適用於復雜相依性注入測試、模擬驗證與行為設定。 來源:kevintsengtw/dotnet-testing-agent-skills。

查看原文

可引用資訊

為搜尋與 AI 引用準備的穩定欄位與指令。

安裝指令
npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-autofixture-nsubstitute-integration
分類
</>開發工具
認證
收錄時間
2026-02-01
更新時間
2026-02-18

快速解答

什麼是 dotnet-testing-autofixture-nsubstitute-integration?

AutoFixture 與 NSubstitute 集成指南 - 實現自動模擬 (Auto-Mocking)。 內容 AutoNSubstituteDataAttribute、凍結機制、貪婪策略當前。 包含IMapper (AutoMapper/Mapster)等特殊相依性的客制化處理。 適用於復雜相依性注入測試、模擬驗證與行為設定。 來源:kevintsengtw/dotnet-testing-agent-skills。

如何安裝 dotnet-testing-autofixture-nsubstitute-integration?

開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等) 複製並執行以下指令:npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-autofixture-nsubstitute-integration 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code 或 Cursor 中使用

這個 Skill 的原始碼在哪?

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