C# MSTest 测试
原名:csharp-mstest
使用 MSTest 现代断言和数据驱动能力编写 .NET 测试。
中文 Skills 技能说明
适合采用 MSTest 3 或 4 的 C# 项目。先核对目标框架与现有测试约定,再选择合适断言和生命周期;数据库与外部接口使用隔离测试环境。
上游能力依据
上游原始适用说明:Get best practices for MSTest 3.x/4.x unit testing, including modern assertion APIs and data-driven tests
上游 SKILL.md 主要章节(保留原文标题):
- Project Setup
- Test Class Structure
- Test Lifecycle
- Execution Order
- Modern Assertion APIs
- Assert Class - Core Assertions
- Exception Testing (Prefer over [ExpectedException])
- Collection Assertions (Assert class)
- String Assertions (Assert class)
- Comparison Assertions
使用边界
先复现问题并固定测试范围,再生成或执行测试。测试通过只能证明已覆盖的场景,不能代替生产环境验收。
作者、翻译与许可证
- 原作者
- GitHub, Inc. 与 awesome-copilot contributors
- 中文翻译
- CEOFans翻译
- 许可证
- MIT
- 上游来源
- https://github.com/github/awesome-copilot/tree/3f0bba475ec40b9680e1d0311b9caffeec5ad4c3/skills/csharp-mstest
适用范围
平台:linux、macos、windows;标签:测试与质量、C# MSTest 测试
安全提示
基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。
如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。