dotnet-testing-unit-test-fundamentals
✓.NET 單元測試基礎與 FIRST 原則的專門技能。 當需要建立單元測試、了解測試基礎、學習 3A Pattern、掌握測試最佳實踐時使用。 涵蓋 FIRST 原則、AAA Pattern、Fact/Theory、測試金字塔等。
SKILL.md
| Arrange | 準備測試所需的物件、資料、Mock | 使用 const 宣告常數值,提高可讀性 | | Act | 執行被測試的方法 | 通常只有一行,呼叫被測方法 | | Assert | 驗證結果 | 每個測試只驗證一個行為 |
| Add輸入1和2應回傳3 | 測試正常輸入 | | Add輸入負數和正數應回傳正確結果 | 測試邊界條件 | | Divide輸入10和0應拋出DivideByZeroException | 測試例外情況 | | IsValidEmail輸入null值應回傳False | 測試無效輸入 | | GetDomain輸入有效Email應回傳網域名稱 | 測試回傳值 |
| Assert.Equal(expected, actual) | 驗證相等 | | Assert.NotEqual(expected, actual) | 驗證不相等 | | Assert.True(condition) | 驗證條件為真 | | Assert.False(condition) | 驗證條件為假 | | Assert.Null(object) | 驗證為 null | | Assert.NotNull(object) | 驗證不為 null | | Assert.Throws (action) | 驗證拋出特定例外 | | Assert.Empty(collection) | 驗證集合為空 | | Assert.Contains(item, collection) | 驗證集合包含項目 |
.NET 單元測試基礎與 FIRST 原則的專門技能。 當需要建立單元測試、了解測試基礎、學習 3A Pattern、掌握測試最佳實踐時使用。 涵蓋 FIRST 原則、AAA Pattern、Fact/Theory、測試金字塔等。 来源:kevintsengtw/dotnet-testing-agent-skills。
可引用信息
为搜索与 AI 引用准备的稳定字段与命令。
- 安装命令
npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-unit-test-fundamentals- 分类
- </>开发工具
- 认证
- ✓
- 收录时间
- 2026-02-01
- 更新时间
- 2026-02-18
快速解答
什么是 dotnet-testing-unit-test-fundamentals?
.NET 單元測試基礎與 FIRST 原則的專門技能。 當需要建立單元測試、了解測試基礎、學習 3A Pattern、掌握測試最佳實踐時使用。 涵蓋 FIRST 原則、AAA Pattern、Fact/Theory、測試金字塔等。 来源:kevintsengtw/dotnet-testing-agent-skills。
如何安装 dotnet-testing-unit-test-fundamentals?
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-unit-test-fundamentals 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用
这个 Skill 的源码在哪?
https://github.com/kevintsengtw/dotnet-testing-agent-skills
详情
- 分类
- </>开发工具
- 来源
- skills.sh
- 收录时间
- 2026-02-01