Official agent skill

Dotnet Test Frameworks

by microsoft in microsoft/testfx

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.

OfficialMITAuto-check passedTesting & QA

Install Dotnet Test Frameworks

skills CLI
$ npx skills add microsoft/testfx --skill dotnet-test-frameworks -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/testfx dotnet-test-frameworks --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/dotnet-test-frameworks .claude/skills/dotnet-test-frameworks && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dotnet-test-frameworks
GitHub stars
1k
Token cost
~1.8k tokens
SKILL.md length
460 words
Files
1
Skills in repo
44
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Tasks that involve Unit testing
  • SKILL.md covers Test File Identification, Assertion APIs by Framework, Sleep/Delay Patterns and Skip/Ignore Annotations, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Dotnet Test Frameworks is an agent skill from microsoft/testfx, published by the product's own GitHub organization. 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. Loaded by test analysis skills (test-anti-patterns) as framework-specific lookup tables.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing. It works with .NET. The repository describes itself as: This repository holds the source code of Microsoft.Testing.Platform (MTP), a lightweight alternative to VSTest, as well as MSTest adapter and framework. The licence is MIT.

When your agent uses it

  • Tasks that involve Unit testing

Example prompts

  • “/dotnet-test-frameworks”

What it can do on your machine

Read from SKILL.md and the folder at commit 44b9dcc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dotnet Test Frameworks loads about 1.8k tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 460 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~75
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/testfx at commit 44b9dcc, republished under its MIT licence (© microsoft). 460 words, ~1,826 tokens.

Download SKILL.mdSave it as .claude/skills/dotnet-test-frameworks/SKILL.md (or your agent's skills folder).
name
dotnet-test-frameworks
description
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. Loaded by test analysis skills (test-anti-patterns) as framework-specific lookup tables.
user-invocable
false
license
MIT

.NET Test Framework Reference

Language-specific detection patterns for .NET test frameworks (MSTest, xUnit, NUnit, TUnit).

Test File Identification

FrameworkTest class markersTest method markers
MSTest[TestClass][TestMethod], [DataTestMethod]
xUnit(none — convention-based)[Fact], [Theory]
NUnit[TestFixture][Test], [TestCase], [TestCaseSource]
TUnit(none — convention-based)[Test]

Assertion APIs by Framework

CategoryMSTestxUnitNUnitTUnit
EqualityAssert.AreEqualAssert.EqualAssert.That(x, Is.EqualTo(y))await Assert.That(x).IsEqualTo(y)
BooleanAssert.IsTrue / Assert.IsFalseAssert.True / Assert.FalseAssert.That(x, Is.True)await Assert.That(x).IsTrue() / await Assert.That(x).IsFalse()
NullAssert.IsNull / Assert.IsNotNullAssert.Null / Assert.NotNullAssert.That(x, Is.Null)await Assert.That(x).IsNull() / await Assert.That(x).IsNotNull()
ExceptionAssert.Throws<T>() / Assert.ThrowsExactly<T>()Assert.Throws<T>()Assert.That(() => ..., Throws.TypeOf<T>())await Assert.That(() => ...).Throws<T>() / await Assert.That(() => ...).ThrowsExactly<T>()
CollectionCollectionAssert.ContainsAssert.ContainsAssert.That(col, Has.Member(x))await Assert.That(col).Contains(x)
StringStringAssert.ContainsAssert.Contains(str, sub)Assert.That(str, Does.Contain(sub))await Assert.That(str).Contains(sub)
TypeAssert.IsInstanceOfTypeAssert.IsAssignableFromAssert.That(x, Is.InstanceOf<T>())await Assert.That(x).IsAssignableTo<T>() (use await Assert.That(x).IsTypeOf<T>() for exact-type check)
InconclusiveAssert.Inconclusive()skip via [Fact(Skip)]Assert.Inconclusive()Skip.Test("reason") (no true inconclusive state)
FailAssert.Fail()Assert.Fail() (.NET 10+)Assert.Fail()Assert.Fail()

TUnit-specific: assertions are async and must be awaited — a forgotten await causes the assertion to never run, and the test passes silently. A built-in analyzer warns when await is missing. Multiple assertions can be combined with .And / .Or chaining or grouped via Assert.Multiple().

Third-party assertion libraries: Should* (Shouldly), .Should() (FluentAssertions / AwesomeAssertions), Verify() (Verify). TUnit also ships an optional TUnit.Assertions.Should package providing FluentAssertions-style value.Should().BeEqualTo(...) on top of the same infrastructure.

Sleep/Delay Patterns

PatternExample
Thread sleepThread.Sleep(2000)
Task delayawait Task.Delay(1000)
SpinWaitSpinWait.SpinUntil(() => condition, timeout)

Skip/Ignore Annotations

FrameworkAnnotationWith reason
MSTest[Ignore][Ignore("reason")]
xUnit[Fact(Skip = "reason")](reason is required)
NUnit[Ignore("reason")](reason is required)
TUnit[Skip("reason")](reason is required; also valid at class and assembly scope, e.g. [assembly: Skip("…")]. Dynamic in-test skipping via Skip.Test("reason").)
Conditional#if false / #if NEVER(no reason possible)
Show full SKILL.md (189 more words)Show less

Exception Handling — Idiomatic Alternatives

When a test uses try/catch to verify exceptions, suggest the framework-native alternative:

MSTest:

csharp
// 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);

xUnit:

csharp
var ex = Assert.Throws<InvalidOperationException>(
    () => processor.ProcessOrder(emptyOrder));
Assert.Equal("Order must contain at least one item", ex.Message);

NUnit:

csharp
var ex = Assert.Throws<InvalidOperationException>(
    () => processor.ProcessOrder(emptyOrder));
Assert.That(ex.Message, Is.EqualTo("Order must contain at least one item"));

TUnit:

csharp
await Assert.That(() => processor.ProcessOrder(emptyOrder))
    .Throws<InvalidOperationException>()
    .WithMessage("Order must contain at least one item");

// Or, for exact-type matching (no derived types):
await Assert.That(() => processor.ProcessOrder(emptyOrder))
    .ThrowsExactly<InvalidOperationException>();

Mystery Guest — Common .NET Patterns

Smell indicatorWhat to look for
File systemFile.ReadAllText, File.Exists, File.WriteAllBytes, Directory.GetFiles, Path.Combine with hard-coded paths
DatabaseSqlConnection, DbContext (without in-memory provider), SqlCommand
NetworkHttpClient without HttpMessageHandler override, WebRequest, TcpClient
EnvironmentEnvironment.GetEnvironmentVariable, Environment.CurrentDirectory
AcceptableMemoryStream, StringReader, InMemory database providers, custom DelegatingHandler

Integration Test Markers

Recognize these as integration tests (adjust smell severity accordingly):

  • Class name contains Integration, E2E, EndToEnd, or Acceptance
  • [TestCategory("Integration")] (MSTest)
  • [Trait("Category", "Integration")] (xUnit)
  • [Category("Integration")] (NUnit, TUnit)
  • Project name ending in .IntegrationTests or .E2ETests

Setup/Teardown Methods

FrameworkSetupTeardown
MSTest[TestInitialize] or constructor[TestCleanup] or IDisposable.Dispose / IAsyncDisposable.DisposeAsync
xUnitconstructorIDisposable.Dispose / IAsyncDisposable.DisposeAsync
NUnit[SetUp][TearDown]
TUnit[Before(Test)] or constructor[After(Test)] or IDisposable.Dispose / IAsyncDisposable.DisposeAsync
MSTest (class)[ClassInitialize][ClassCleanup]
NUnit (class)[OneTimeSetUp][OneTimeTearDown]
xUnit (class)IClassFixture<T>fixture's Dispose
TUnit (class)[Before(Class)][After(Class)]
TUnit (assembly)[Before(Assembly)][After(Assembly)]
TUnit (session)[Before(TestSession)][After(TestSession)]

TUnit-specific: [BeforeEvery(Test)] / [AfterEvery(Test)] (and the Class / Assembly variants) run for every test/class/assembly across the whole test run — useful for global cross-cutting hooks. Hooks may optionally accept a context object (TestContext, ClassHookContext, etc.) and/or a CancellationToken.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/dotnet-test-frameworks of microsoft/testfx.

Open the folder on GitHubat commit 44b9dcc

Compare with similar skills

Dotnet Test Frameworks next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dotnet Test Frameworks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dotnet Test Frameworks this skillmicrosoft/testfx1k—~1.8kAutomated safety check: PassMIT
New Event Sourceaws/aws-lambda-dotnet1.7k—~3kAutomated safety check: PassApache-2.0
ScottPlot Test RunnerScottPlot/ScottPlot6.8k—~308Automated safety check: PassMIT
Aspire Integration TestingDevBetterCom/DevBetterWeb1572 repos~2.3kAutomated safety check: PassNone
Vstest Build Testmicrosoft/vstest969—~1.9kAutomated safety check: PassMIT
Coverage Analysisrunceel/ReactiveProperty944—~5.9kAutomated safety check: WarnMIT

Similar skills

  • New Event Source

    aws/aws-lambda-dotnet

    Official

    Add a new AWS event source attribute (e.g., Kinesis, Kafka, MQ) to the Lambda .NET Annotations framework, including the attribute class, source generator integration, CloudFormation writer, unit…

    1.7k GitHub stars~3k tokensUpdated today
    Testing & QAAuto-check passed
  • ScottPlot Test Runner

    ScottPlot/ScottPlot

    Run or add ScottPlot 5 tests. Use for unit-test and cookbook-test work; unless explicitly asked otherwise, restrict manual test execution to the Unit Tests…

    6.8k GitHub stars~308 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Aspire Integration Testing

    DevBetterCom/DevBetterWeb

    Write integration tests using .NET Aspire's testing facilities with xUnit.

    157 GitHub starsUsed in 2 repos~2.3k tokens
    Testing & QAAuto-check passed
  • Vstest Build Test

    microsoft/vstest

    Official

    Build, test, and validate changes in the vstest repository. An agent skill from microsoft/vstest.

    969 GitHub stars~1.9k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Coverage Analysis

    runceel/ReactiveProperty

    Automated, project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects with existing unit tests.

    944 GitHub stars~5.9k tokensUpdated 1 mo ago
    Testing & QAAuto-check: warnings
  • Unit Testing

    OpenCoreMMO/OpenCoreMMO

    Write, fix, or review NeoServer unit tests using xUnit and FluentAssertions.

    481 GitHub stars~1.6k tokensUpdated 14 days ago
    Testing & QAAuto-check passed

More from microsoft/testfx

All 44 skills in this repo
  • Official

    Guide for organizing MSBuild infrastructure with Directory.Build.props, Directory.Build.targets, Directory.Packages.props, and Directory.Build.rsp.

    1k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Binlog Failure Analysis

    microsoft/testfx

    Official

    Analyze MSBuild binary logs to diagnose build failures. An agent skill from microsoft/testfx.

    1k GitHub starsUsed in 3 repos~730 tokens
    Auto-check passed
  • Coverage Analysis

    microsoft/testfx

    Official

    Project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects.

    1k GitHub stars~7.3k tokensUpdated today
    Auto-check passed
  • Incremental Build

    microsoft/testfx

    Official

    Guide for optimizing MSBuild incremental builds. An agent skill from microsoft/testfx.

    1k GitHub starsUsed in 3 repos~3.7k tokens
    Auto-check passed
  • Msbuild Modernization

    microsoft/testfx

    Official

    Guide for modernizing and migrating MSBuild project files to SDK-style format.

    1k GitHub starsUsed in 3 repos~4.3k tokens
    Auto-check passed
  • Msbuild Antipatterns

    microsoft/testfx

    Official

    Catalog of MSBuild anti-patterns with detection rules and fix recipes.

    1k GitHub stars~4.5k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Dotnet Test Frameworks

What does Dotnet Test Frameworks do?

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. Dotnet Test Frameworks is an agent skill from microsoft/testfx, published by the product's own GitHub organization.NET test framework detection patterns, assertion APIs, skip annotations, setup/teardown methods, and common test smell indicators across MSTest, xUnit, NUnit, and TUnit.

When should I use Dotnet Test Frameworks?

Dotnet Test Frameworks fits situations like: tasks that involve Unit testing.

How do I install Dotnet Test Frameworks in Claude Code?

Run `npx skills add microsoft/testfx --skill dotnet-test-frameworks -a claude-code`. Or copy the skill folder (.agents/skills/dotnet-test-frameworks in microsoft/testfx) into .claude/skills/dotnet-test-frameworks in your project. Claude Code loads it when a task matches its description.

How do I install Dotnet Test Frameworks in Codex?

Run `npx skills add microsoft/testfx --skill dotnet-test-frameworks -a codex`. Or copy the skill folder (.agents/skills/dotnet-test-frameworks in microsoft/testfx) into .agents/skills/dotnet-test-frameworks in your project. Codex loads it when a task matches its description.

Can I use Dotnet Test Frameworks in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/testfx --skill dotnet-test-frameworks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dotnet-test-frameworks, .gemini/skills/dotnet-test-frameworks, .github/skills/dotnet-test-frameworks and .opencode/skills/dotnet-test-frameworks in your project.

What does Dotnet Test Frameworks need to run?

SKILL.md names no scripts, command-line tools or credentials: Dotnet Test Frameworks is instructions for the agent only.

Does Dotnet Test Frameworks access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dotnet Test Frameworks safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dotnet Test Frameworks use?

Dotnet Test Frameworks is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dotnet Test Frameworks use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dotnet Test Frameworks?

Skills that share tags, products or a category with Dotnet Test Frameworks: New Event Source (aws/aws-lambda-dotnet, 1.7k stars), ScottPlot Test Runner (ScottPlot/ScottPlot, 6.8k stars), Aspire Integration Testing (DevBetterCom/DevBetterWeb, 157 stars) and Vstest Build Test (microsoft/vstest, 969 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dotnet Test Frameworks?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/testfx, which has 1,047 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on October 7, 2026.

Source: microsoft/testfx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.