🎯

dotnet-testing-nsubstitute-mocking

🎯Skill

from kevintsengtw/dotnet-testing-agent-skills

VibeIndex|
What it does

Provides guidance and code generation for creating unit tests with NSubstitute mocking in .NET, helping developers easily mock dependencies and create isolated test scenarios.

dotnet-testing-nsubstitute-mocking

Installation

Install skill:
npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-nsubstitute-mocking
7
Last UpdatedJan 25, 2026

Skill Details

SKILL.md

Overview

# .NET Testing Agent Skills

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

[![.NET](https://img.shields.io/badge/.NET-8.0+-512BD4?logo=dotnet)](https://dotnet.microsoft.com/)

[![xUnit](https://img.shields.io/badge/xUnit-2.x-5C2D91)](https://xunit.net/)

[![xUnit](https://img.shields.io/badge/xUnit-3.x-5C2D91)](https://xunit.net/)

> 🏆 基於 2025 iThome 鐵人賽 Software Development 組冠軍作品「老派軟體工程師的測試修練 - 30 天挑戰」提煉而成

專為 .NET 開發者打造的 AI Agent Skills 集合,涵蓋從單元測試到整合測試的完整最佳實踐。讓 GitHub Copilot、Claude 等 AI 助理自動為您提供專業的測試指導!

---

✨ 特色

  • 🎯 自動觸發:AI 根據對話內容自動載入相關技能
  • 📚 29 個精煉技能:包含 2 個總覽技能 + 27 個專業技能,涵蓋單元測試、模擬、測試資料生成、整合測試等
  • 🔧 即用範本:提供完整的專案結構與程式碼範例
  • 🌐 多平台支援:GitHub Copilot、Claude Code、Cursor 等
  • 📖 中文友善:完整的繁體中文文件與命名建議
  • 📦 標準化結構:符合 Claude Code skills 標準,支援 npx skills install 安裝

---

🚀 快速開始

方法一:使用 npx skills install(推薦)

```bash

# 從 GitHub 直接安裝到 Claude Code 全域 skills

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

# 或安裝到當前工作區

npx skills install https://github.com/kevintsengtw/dotnet-testing-agent-skills.git --workspace

```

方法二:直接複製

#### 複製到 GitHub Copilot(VS Code)

Linux / macOS (Bash)

```bash

# 1. Clone 此 repo

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

# 2. 複製到您的專案(GitHub Copilot 使用 .github/skills)

cp -r dotnet-testing-agent-skills/skills /your-project/.github/

# 3. 在 VS Code 中啟用 Agent Skills

# 設定 → 搜尋 "chat.useAgentSkills" → 勾選啟用

```

Windows (PowerShell)

```powershell

# 1. Clone 此 repo

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

# 2. 複製到您的專案(GitHub Copilot 使用 .github/skills)

Copy-Item -Path "dotnet-testing-agent-skills\skills" -Destination "\your-project\.github\" -Recurse

# 3. 在 VS Code 中啟用 Agent Skills

# 設定 → 搜尋 "chat.useAgentSkills" → 勾選啟用

```

#### 複製到 Claude Code

Linux / macOS (Bash)

```bash

# 複製到 Claude Code 工作區 skills

cp -r dotnet-testing-agent-skills/skills /your-project/.claude/

# 或複製到全域 skills

cp -r dotnet-testing-agent-skills/skills ~/.config/claude/

```

Windows (PowerShell)

```powershell

# 複製到 Claude Code 工作區 skills

Copy-Item -Path "dotnet-testing-agent-skills\skills" -Destination "\your-project\.claude\" -Recurse

# 或複製到全域 skills

Copy-Item -Path "dotnet-testing-agent-skills\skills" -Destination "$env:APPDATA\claude\" -Recurse

```

方法三:Git Submodule

```bash

cd /your-project

# 對 GitHub Copilot:加入 submodule 到 .github/skills

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

cd .github/skills && cp -r skills/* . && cd ../..

# 對 Claude Code:加入 submodule 到 .claude/skills

git submodule add https://github.com/kevintsengtw/dotnet-testing-agent-skills .claude/skills

cd .claude/skills && cp -r skills/* . && cd ../..

```

方法四:選擇性複製

只需要特定技能?

#### Linux / macOS (Bash)

```bash

# 只複製單元測試基礎

cp -r dotnet-testing-agent-skills/skills/dotnet-testing-unit-test-fundamentals /your-project/.github/skills/

# 只複製 AutoFixture 系列

cp -r dotnet-testing-agent-skills/skills/dotnet-testing-autofixture-* /your-project/.github/skills/

# 只複製總覽 skills

cp -r dotnet-testing-agent-skills/skills/dotnet-testing /your-project/.github/skills/

cp -r dotnet-testing-agent-skills/skills/dotnet-testing-advanced /your-project/.github/skills/

```

#### Windows (PowerShell)

```powershell

# 只複製單元測試基礎

Copy-Item -Path "dotnet-testing-agent-skills\skills\dotnet-testing-unit-test-fundamentals" -Destination "\your-project\.github\skills\" -Recurse

# 只複製 AutoFixture 系列

Get-ChildItem -Path "dotnet-testing-agent-skills\skills\dotnet-testing-autofixture-*" | Copy-Item -Destination "\your-project\.github\skills\" -Recurse

# 只複製總覽 skills

Copy-Item -Path "dotnet-testing-agent-skills\skills\dotnet-testing" -Destination "\your-project\.github\skills\" -Recurse

Copy-Item -Path "dotnet-testing-agent-skills\skills\dotnet-testing-advanced" -Destination "\your-project\.github\skills\" -Recurse

```

---

目錄結構

```tex

More from this repository10

🎯
dotnet-testing-autofixture-nsubstitute-integration🎯Skill

Simplifies .NET unit testing by integrating AutoFixture for test data generation and NSubstitute for mocking dependencies

🎯
dotnet-testing-xunit-project-setup🎯Skill

Automatically sets up a new xUnit testing project structure for .NET, generating standard test project configurations and initial test class templates.

🎯
dotnet-testing-advanced-testcontainers-database🎯Skill

Provides advanced guidance and code generation for setting up database integration tests using Testcontainers in .NET, enabling developers to create robust, isolated database testing scenarios with...

🎯
dotnet-testing-advanced-aspire-testing🎯Skill

Provides advanced testing guidance and strategies for .NET Aspire applications, focusing on comprehensive integration and component testing techniques.

🎯
dotnet-testing-advanced-webapi-integration-testing🎯Skill

Provides advanced guidance and code generation for creating comprehensive integration tests for .NET Web API projects using best practices and xUnit testing frameworks.

🎯
dotnet-testing-fluentvalidation-testing🎯Skill

Generates and validates unit tests for .NET projects using FluentValidation, focusing on creating comprehensive test scenarios for validation logic and rules.

🎯
dotnet-testing-code-coverage-analysis🎯Skill

Analyzes code coverage for .NET projects, generating comprehensive test coverage reports and identifying untested or low-coverage code segments.

🎯
dotnet-testing-advanced-tunit-advanced🎯Skill

dotnet-testing-advanced-tunit-advanced skill from kevintsengtw/dotnet-testing-agent-skills

🎯
dotnet-testing-bogus-fake-data🎯Skill

dotnet-testing-bogus-fake-data skill from kevintsengtw/dotnet-testing-agent-skills

🎯
dotnet-testing-datetime-testing-timeprovider🎯Skill

Provides guidance and code examples for testing datetime-dependent code using TimeProvider in .NET, helping developers create more predictable and controllable unit tests involving time-sensitive l...