csharp-xunit by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill csharp-xunit你的目标是帮助我编写高效的 XUnit 单元测试,涵盖标准和数据驱动测试方法。
[项目名].TestsCalculator 创建 CalculatorTests)dotnet test 来运行测试[Fact] 属性的基于事实的测试进行简单测试方法名_场景_预期行为 模式命名测试IDisposable.Dispose() 进行清理广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
IClassFixture<T> 实现类内测试间的共享上下文ICollectionFixture<T> 实现多个测试类间的共享上下文[Theory] 结合数据源属性[InlineData] 进行内联测试数据[MemberData] 进行基于方法的测试数据[ClassData] 进行基于类的测试数据DataAttribute 创建自定义数据属性Assert.Equal 进行值相等性判断Assert.Same 进行引用相等性判断Assert.True/Assert.False 进行布尔条件判断Assert.Contains/Assert.DoesNotContain 进行集合判断Assert.Matches/Assert.DoesNotMatch 进行正则表达式模式匹配Assert.Throws<T> 或 await Assert.ThrowsAsync<T> 测试异常[Trait("Category", "类别名")] 进行分类ITestOutputHelper) 进行测试诊断Skip = "原因" 有条件地跳过测试每周安装量
7.4K
代码库
GitHub 星标数
26.7K
首次出现
2026年2月25日
安全审计
安装于
codex7.3K
gemini-cli7.3K
opencode7.3K
github-copilot7.3K
cursor7.3K
amp7.3K
Your goal is to help me write effective unit tests with XUnit, covering both standard and data-driven testing approaches.
[ProjectName].TestsCalculatorTests for Calculator)dotnet test for running tests[Fact] attribute for simple testsMethodName_Scenario_ExpectedBehaviorIDisposable.Dispose() for teardownIClassFixture<T> for shared context between tests in a classICollectionFixture<T> for shared context between multiple test classes[Theory] combined with data source attributes[InlineData] for inline test data[MemberData] for method-based test data[ClassData] for class-based test dataDataAttributeAssert.Equal for value equalityAssert.Same for reference equalityAssert.True/Assert.False for boolean conditionsAssert.Contains/Assert.DoesNotContain for collectionsAssert.Matches/Assert.DoesNotMatch for regex pattern matchingAssert.Throws<T> or await Assert.ThrowsAsync<T> to test exceptions[Trait("Category", "CategoryName")] for categorizationITestOutputHelper) for test diagnosticsSkip = "reason" in fact/theory attributesWeekly Installs
7.4K
Repository
GitHub Stars
26.7K
First Seen
Feb 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex7.3K
gemini-cli7.3K
opencode7.3K
github-copilot7.3K
cursor7.3K
amp7.3K
97,600 周安装