PlugWiki

csharp-mstest Skill (awesome-copilot) for Claude Code: What It Does and How to Install It

Makes Claude write C# unit tests with current MSTest 3.x and 4.x patterns, including modern assertions and data-driven tests.

Installs
8.9K
on skills.sh
Stars
40.7K
on GitHub
Updated
Oct 2026
last repo commit

Claude follows a set of MSTest rules when it writes or fixes tests. They include a separate [ProjectName].Tests project, sealed [TestClass] classes, constructors instead of [TestInitialize], Assert.Throws instead of [ExpectedException], and the Assert class over StringAssert and CollectionAssert where an equivalent exists.

The folder has one file, SKILL.md, and no scripts. SKILL.md also covers data-driven tests, TestContext, retries, OS and CI conditions, parallelization and mocking with Moq or NSubstitute. It marks features that need a newer MSTest, from 3.6 up to 4.0.

Good for

  • .NET developers writing unit tests with MSTest
  • Teams moving old [ExpectedException] and CollectionAssert tests to current APIs
  • Anyone adding data-driven tests with [DataRow] or [DynamicData]

Install csharp-mstest

Claude Code

  1. 1

    Download the skill folder from https://github.com/github/awesome-copilot/tree/HEAD/skills/csharp-mstest.

  2. 2

    Put it at ~/.claude/skills/csharp-mstest/ so that SKILL.md sits directly inside.

  3. 3

    Start a new session; the skill loads when its description matches the task.

Pick one route. The Copilot CLI plugin route installs the csharp-dotnet-development plugin from the awesome-copilot marketplace: 9 skills (csharp-async, csharp-mstest, csharp-nunit, csharp-tunit, csharp-xunit, aspnet-minimal-api-openapi, dotnet-best-practices, dotnet-upgrade, resx-source-generator-migration) and the expert-dotnet-software-engineer agent. The other routes install only csharp-mstest. The repo README says its customizations come from third-party developers, so inspect them before installing.

Built from the package data we hold. Not yet tested by us.

What's in the skill

When it loads

Get best practices for MSTest 3.x/4.x unit testing, including modern assertion APIs and data-driven tests

Sections in SKILL.md

  1. Project Setup
  2. Test Class Structure
  3. Test Lifecycle
  4. Execution Order
  5. Modern Assertion APIs
  6. Assert Class - Core Assertions
  7. Exception Testing (Prefer over [ExpectedException])
  8. Collection Assertions (Assert class)
  9. String Assertions (Assert class)
  10. Comparison Assertions
  11. Type Assertions
  12. Assert.That (MSTest 4.0+)
  13. StringAssert Class
  14. CollectionAssert Class
  15. Data-Driven Tests
  16. DataRow

Key facts

Installs on skills.sh
8,864 (Nov 2, 2026)
Last repo commit
Oct 30, 2026

What it includes

  • Separate [ProjectName].Tests project, MSTest 3.x+ packages, dotnet test

    Mentions MSTest.Sdk for simpler project setup.

    Runs code · Project setup

  • Sealed [TestClass] classes, [TestMethod], Arrange-Act-Assert naming

    Names tests MethodName_Scenario_ExpectedBehavior and prefers [TestMethod] over [DataTestMethod].

    Try: “Write MSTest tests for my OrderService class”

    Write · Test class structure

  • Prefer constructors over [TestInitialize]; 7-step execution order

    Covers assembly, class and test initialize and cleanup, and the order they run in.

    Write · Test lifecycle

  • Assert, StringAssert and CollectionAssert, with Assert preferred

    Includes Assert.Throws instead of [ExpectedException], comparison assertions, type assertions and Assert.That (MSTest 4.0+).

    Write · Modern assertions

  • [DataRow] and [DynamicData] with ValueTuple or TestDataRow

    Marks IEnumerable<object[]> as the least preferred data source.

    Write · Data-driven tests

  • Constructor injection, cancellation token, run properties, result files

    Says to flow TestContext.CancellationToken with [Timeout].

    Write · TestContext

  • [Retry], [OSCondition], [CICondition], parallelization, work items

    Each is marked with the MSTest version that adds it, such as 3.9+ for Retry and 3.10+ for conditions.

    Write · Advanced features

  • Wrong argument order, ExpectedException, Single(), hard casts

    Shows each mistake next to the fix.

    Read · Common mistakes

  • [TestCategory], [TestProperty], [Priority]; Moq or NSubstitute

    Suggests enabling analyzers such as MSTEST0020.

    Read · Test organization and mocking

From the official docs

Permissions

Low risk

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It edits your test code

    Claude writes and changes test classes and the test project in your repo. Review the diff and run the tests yourself before you commit. github.com

  • The plugin route also adds an agent and 8 other skills

    The plugin.json lists 9 skills and one agent, expert-dotnet-software-engineer. That agent's file lists tools such as runCommands, runTasks, edit/editFiles and fetch. Use a folder route or the skills CLI if you want only csharp-mstest. github.com

Technical details
Turning on read-onlyNo read-only mode.
Sign-in and keysNo credentials are named in SKILL.md.
Scopes
  • Writes C# test classes and test project files in your repo

  • SKILL.md lists dotnet test as the way to run tests

Questions

What does the csharp-mstest skill do?

It makes Claude write C# unit tests with current MSTest 3.x and 4.x patterns. That covers sealed test classes, modern assertions, data-driven tests and the TestContext class.

Which MSTest version do I need?

MSTest 3.x or newer. SKILL.md marks newer features with their version, for example Retry needs 3.9+, OS and CI conditions need 3.10+, and Assert.That needs 4.0+.

Are there skills for other test frameworks?

Yes, in the same plugin. Its plugin.json also lists csharp-nunit, csharp-xunit and csharp-tunit. This page covers MSTest only.

How do I install it?

Use the install box at the top of this page. The repo README documents Copilot CLI plugins from the awesome-copilot marketplace, and the csharp-dotnet-development plugin includes this skill. The box also has folder routes that install only this skill.

Does it run my tests?

SKILL.md names dotnet test as the way to run tests. Ask Claude to run it, and check the result yourself.

Does it include scripts?

It bundles no scripts. The folder has only SKILL.md.

Is it safe?

It guides Claude to write and change test code in your repo, so review the diff and run the tests before you commit. The plugin route also installs eight more skills and an agent, which you can avoid with a folder route.

Information

updated Nov 2, 2026

Folder
skills/csharp-mstest

github/awesome-copilotskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 5
  1. csharp-mstest SKILL.md · github.com
  2. awesome-copilot README · github.com
  3. csharp-dotnet-development plugin.json · github.com
  4. awesome-copilot LICENSE · github.com
  5. expert-dotnet-software-engineer agent · github.com

Updated Nov 2, 2026.