dotnet-test-frameworks

Provides detection patterns and assertion API references for MSTest, xUnit, NUnit, and TUnit test frameworks.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill dotnet-test-frameworks-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-test-frameworks
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/dotnet-test-frameworks
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill dotnet-test-frameworks-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Analyzing .NET test code requires knowing how each framework marks tests, asserts values, skips cases, and manages setup/teardown, and this reference supplies those framework-specific lookup tables so test analysis stays accurate across MSTest, xUnit, NUnit, and TUnit. ## Core Features & Use Cases - Framework Detection Tables: Identify test classes and methods via markers like [TestMethod], [Fact], [TestCase], and TUnit's [Test]. - Assertion API Mappings: Compare equality, exception, collection, and type assertions across all four frameworks, including TUnit's async assertion model. - Test Smell Indicators: Detect sleep/delay patterns, Mystery Guest dependencies on files, databases, and networks, plus integration test markers. - Use Case: When reviewing a test suite that uses try/catch to verify exceptions, look up the idiomatic alternative such as Assert.Throws<T>() for xUnit or await Assert.That(...).Throws<T>() for TUnit. ## Quick Start Ask the assistant to analyze this C# test file for framework-specific anti-patterns using the .NET test framework reference tables.

Frequently Asked Questions about dotnet-test-frameworks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect which .NET test framework a test file uses?

Check the test class and method attributes: MSTest uses [TestClass] and [TestMethod], xUnit uses [Fact] and [Theory] with no class marker, NUnit uses [TestFixture] and [Test], and TUnit uses [Test] with convention-based classes.

What is the difference between MSTest, xUnit, NUnit, and TUnit assertions?

MSTest uses Assert.AreEqual and Assert.IsTrue, xUnit uses Assert.Equal and Assert.True, NUnit uses Assert.That with constraint syntax like Is.EqualTo, and TUnit uses async assertions like await Assert.That(x).IsEqualTo(y) that must be awaited.

How do I skip a test in xUnit, NUnit, MSTest, or TUnit?

MSTest uses [Ignore("reason")], xUnit requires [Fact(Skip = "reason")], NUnit uses [Ignore("reason")], and TUnit uses [Skip("reason")] which also works at class and assembly scope plus dynamic skipping via Skip.Test("reason").

Why does my TUnit assertion never run and the test still passes?

TUnit assertions are async and must be awaited; a forgotten await means the assertion never executes and the test passes silently. TUnit ships a built-in analyzer that warns when the await is missing.

What is the idiomatic way to test exceptions instead of try/catch?

Use the framework-native API: Assert.ThrowsExactly<T>() or Assert.Throws<T>() in MSTest, Assert.Throws<T>() in xUnit and NUnit, and await Assert.That(() => ...).Throws<T>() in TUnit, then assert on the returned exception's message.

How do I recognize integration tests versus unit tests in .NET?

Look for class names containing Integration, E2E, or Acceptance, category attributes like [TestCategory("Integration")], [Trait("Category", "Integration")], or [Category("Integration")], and project names ending in .IntegrationTests or .E2ETests.