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
Download the skill folder from https://github.com/github/awesome-copilot/tree/HEAD/skills/csharp-mstest.
- 2
Put it at ~/.claude/skills/csharp-mstest/ so that SKILL.md sits directly inside.
- 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
- Project Setup
- Test Class Structure
- Test Lifecycle
- Execution Order
- Modern Assertion APIs
- Assert Class - Core Assertions
- Exception Testing (Prefer over [ExpectedException])
- Collection Assertions (Assert class)
- String Assertions (Assert class)
- Comparison Assertions
- Type Assertions
- Assert.That (MSTest 4.0+)
- StringAssert Class
- CollectionAssert Class
- Data-Driven Tests
- DataRow
Key facts
- License
- MIT (repo LICENSE)
- Installs on skills.sh
- 8,864 (Nov 2, 2026)
- Last repo commit
- Oct 30, 2026
- Audits on skills.sh
- Gen Agent Trust Hub: pass, Socket: pass, Snyk: pass
- What it includes
- 1 file: SKILL.md (no scripts)
What it includes
Separate [ProjectName].Tests project, MSTest 3.x+ packages, dotnet test
Mentions MSTest.Sdk for simpler project setup.
Runs code ·
Project setupSealed [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 structurePrefer constructors over [TestInitialize]; 7-step execution order
Covers assembly, class and test initialize and cleanup, and the order they run in.
Write ·
Test lifecycleAssert, 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 testsConstructor 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 featuresWrong 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-only | No read-only mode. |
|---|---|
| Sign-in and keys | No credentials are named in SKILL.md. |
| Scopes |
|
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
- Repository
- github/awesome-copilot
- Folder
skills/csharp-mstest
Sources
Docs, issue trackers and discussions this page is built from.
Show all 5Hide
- csharp-mstest SKILL.md · github.com
- awesome-copilot README · github.com
- csharp-dotnet-development plugin.json · github.com
- awesome-copilot LICENSE · github.com
- expert-dotnet-software-engineer agent · github.com