Loading...
Loading...
Reference data for .NET test framework detection patterns, assertion APIs, skip annotations, setup/teardown methods, and common test smell indicators across MSTest, xUnit, NUnit, and TUnit. DO NOT USE directly — loaded by test analysis skills (test-anti-patterns, exp-test-smell-detection, exp-assertion-quality, exp-test-maintainability, exp-test-tagging) when they need framework-specific lookup tables.
npx skill4agent add dotnet/skills dotnet-test-frameworks| Framework | Test class markers | Test method markers |
|---|---|---|
| MSTest | | |
| xUnit | (none — convention-based) | |
| NUnit | | |
| TUnit | | |
| Category | MSTest | xUnit | NUnit |
|---|---|---|---|
| Equality | | | |
| Boolean | | | |
| Null | | | |
| Exception | | | |
| Collection | | | |
| String | | | |
| Type | | | |
| Inconclusive | | skip via | |
| Fail | | | |
Should*.Should()Verify()| Pattern | Example |
|---|---|
| Thread sleep | |
| Task delay | |
| SpinWait | |
| Framework | Annotation | With reason |
|---|---|---|
| MSTest | | |
| xUnit | | (reason is required) |
| NUnit | | (reason is required) |
| TUnit | | (reason is required) |
| Conditional | | (no reason possible) |
trycatch// Instead of try/catch (matches exact type):
var ex = Assert.ThrowsExactly<InvalidOperationException>(
() => processor.ProcessOrder(emptyOrder));
Assert.AreEqual("Order must contain at least one item", ex.Message);
// Or (also matches derived types):
var ex = Assert.Throws<InvalidOperationException>(
() => processor.ProcessOrder(emptyOrder));
Assert.AreEqual("Order must contain at least one item", ex.Message);var ex = Assert.Throws<InvalidOperationException>(
() => processor.ProcessOrder(emptyOrder));
Assert.Equal("Order must contain at least one item", ex.Message);var ex = Assert.Throws<InvalidOperationException>(
() => processor.ProcessOrder(emptyOrder));
Assert.That(ex.Message, Is.EqualTo("Order must contain at least one item"));| Smell indicator | What to look for |
|---|---|
| File system | |
| Database | |
| Network | |
| Environment | |
| Acceptable | |
IntegrationE2EEndToEndAcceptance[TestCategory("Integration")][Trait("Category", "Integration")][Category("Integration")].IntegrationTests.E2ETests| Framework | Setup | Teardown |
|---|---|---|
| MSTest | | |
| xUnit | constructor | |
| NUnit | | |
| MSTest (class) | | |
| NUnit (class) | | |
| xUnit (class) | | fixture's |