New Event Source
aws/aws-lambda-dotnet
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…
Write new MSTest unit tests and fix existing MSTest code using MSTest 3.x/4.x modern APIs and best practices.
$ npx skills add microsoft/testfx --skill writing-mstest-tests -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install microsoft/testfx writing-mstest-tests --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/writing-mstest-tests .claude/skills/writing-mstest-tests && rm -rf skills-srcUse ~/.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/
Install the "writing-mstest-tests" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/writing-mstest-tests into .claude/skills/writing-mstest-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-mstest-tests", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/microsoft/testfx/tree/main/.agents/skills/writing-mstest-testsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add microsoft/testfx --skill writing-mstest-tests -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install microsoft/testfx writing-mstest-tests --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/writing-mstest-tests .agents/skills/writing-mstest-tests && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "writing-mstest-tests" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/writing-mstest-tests into .agents/skills/writing-mstest-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-mstest-tests", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/testfx --skill writing-mstest-tests -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install microsoft/testfx writing-mstest-tests --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/writing-mstest-tests .cursor/skills/writing-mstest-tests && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "writing-mstest-tests" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/writing-mstest-tests into .cursor/skills/writing-mstest-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-mstest-tests", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/microsoft/testfx.git --path .agents/skills/writing-mstest-tests--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add microsoft/testfx --skill writing-mstest-tests -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install microsoft/testfx writing-mstest-tests --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/writing-mstest-tests .gemini/skills/writing-mstest-tests && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "writing-mstest-tests" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/writing-mstest-tests into .gemini/skills/writing-mstest-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-mstest-tests", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install microsoft/testfx writing-mstest-testsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add microsoft/testfx --skill writing-mstest-tests -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/writing-mstest-tests .github/skills/writing-mstest-tests && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "writing-mstest-tests" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/writing-mstest-tests into .github/skills/writing-mstest-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-mstest-tests", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/testfx --skill writing-mstest-tests -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install microsoft/testfx writing-mstest-tests --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/writing-mstest-tests .opencode/skills/writing-mstest-tests && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "writing-mstest-tests" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/writing-mstest-tests into .opencode/skills/writing-mstest-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-mstest-tests", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
writing-mstest-testsWrite new MSTest unit tests and fix existing MSTest code using MSTest 3.x/4.x modern APIs and best practices.
Writing Mstest Tests is an agent skill from microsoft/testfx, published by the product's own GitHub organization. Write new MSTest unit tests and fix existing MSTest code using MSTest 3.x/4.x modern APIs and best practices. USE FOR: write or create MSTest unit tests, fix or modernize MSTest assertions, better MSTest assertion than Assert.IsTrue, replace hard cast with MSTest type assertion, MSTest assertion APIs (IsInstanceOfType, Contains, ContainsSingle, HasCount, IsEmpty, IsNotEmpty, DoesNotContain, StartsWith, EndsWith, MatchesRegex, IsGreaterThan, IsInRange, IsNull), fix swapped Assert.AreEqual arguments, replace…
Its SKILL.md is about 3.1k 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.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 19d717a. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp, xml and json).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Writing Mstest Tests loads about 3.1k tokens when it runs. Until then it costs about 258 tokens; SKILL.md has 761 words of instructions outside code blocks.
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.
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.
The full file from microsoft/testfx at commit 19d717a, republished under its MIT licence (© microsoft). 761 words, ~3,071 tokens.
.claude/skills/writing-mstest-tests/SKILL.md (or your agent's skills folder).Help users write effective, modern unit tests with MSTest 3.x/4.x using current APIs and best practices.
Assert.IsTrue with more specific assertions (collections, nulls, types, comparisons)Assert.AreEqual argument order (expected first, actual second)DynamicData from IEnumerable<object[]> to ValueTuple-based datatest-anti-patterns)run-tests skill)migrate-mstest-v1v2-to-v3)migrate-mstest-v3-to-v4)| Input | Required | Description |
|---|---|---|
| Code under test | No | The production code to be tested |
| Existing test code | No | Current tests to fix, update, or modernize |
| Test scenario description | No | What behavior the user wants to test |
Check the test project for MSTest version and configuration:
MSTest.Sdk (<Sdk Name="MSTest.Sdk">): modern setup, all features availableMSTest metapackage: modern setup (MSTest 3.x+)MSTest.TestFramework + MSTest.TestAdapter: check version for feature availabilityRecommend MSTest.Sdk or the MSTest metapackage for new projects:
<!-- Option 1: MSTest SDK (simplest, recommended for new projects) -->
<Project Sdk="MSTest.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
</Project>When using MSTest.Sdk, put the version in global.json instead of the project file so all test projects get bumped together:
{
"msbuild-sdks": {
"MSTest.Sdk": "3.8.2"
}
}<!-- Option 2: MSTest metapackage -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MSTest" Version="3.8.2" />
</ItemGroup>
</Project>Apply these structural conventions:
sealed for performance and design clarity[TestClass] on the class and [TestMethod] on test methodsMethodName_Scenario_ExpectedBehavior[ProjectName].Tests[TestClass]
public sealed class OrderServiceTests
{
[TestMethod]
public void CalculateTotal_WithDiscount_ReturnsReducedPrice()
{
// Arrange
var service = new OrderService();
var order = new Order { Price = 100m, DiscountPercent = 10 };
// Act
var total = service.CalculateTotal(order);
// Assert
Assert.AreEqual(90m, total);
}
}Pick the most specific assertion for each test scenario. More specific assertions produce better failure messages and make the test's intent clear:
| What you are testing | Assertion |
|---|---|
| Two values are equal | Assert.AreEqual(expected, actual) |
| Same object instance (reference identity) | Assert.AreSame(expected, actual) |
| Value is null | Assert.IsNull(value) |
| Value is not null | Assert.IsNotNull(value) |
| Collection is empty | Assert.IsEmpty(collection) |
| Collection is not empty | Assert.IsNotEmpty(collection) |
| Collection has exactly N items | Assert.HasCount(N, collection) |
| Collection contains an item | Assert.Contains(item, collection) |
| Collection does not contain an item | Assert.DoesNotContain(item, collection) |
| Object is a specific type | Assert.IsInstanceOfType<T>(value) |
| Code throws an exception | Assert.ThrowsExactly<T>(() => ...) |
Prefer Assert class methods over StringAssert or CollectionAssert where both exist.
Assert.AreEqual(expected, actual); // Value equality
Assert.AreSame(expected, actual); // Reference equality -- same object instance
Assert.IsNull(value);
Assert.IsNotNull(value);Assert.Throws instead of [ExpectedException]// Synchronous
var ex = Assert.ThrowsExactly<ArgumentNullException>(() => service.Process(null));
Assert.AreEqual("input", ex.ParamName);
// Async
var ex = await Assert.ThrowsExactlyAsync<InvalidOperationException>(
async () => await service.ProcessAsync(null));Assert.Throws<T> matches T or any derived typeAssert.ThrowsExactly<T> matches only the exact type TAssert.Contains(expectedItem, collection);
Assert.DoesNotContain(unexpectedItem, collection);
var single = Assert.ContainsSingle(collection); // Returns the single element
Assert.HasCount(3, collection);
Assert.IsEmpty(collection);
Assert.IsNotEmpty(collection);Replace generic Assert.IsTrue with specialized assertions -- they give better failure messages:
| Instead of | Use |
|---|---|
Assert.IsTrue(list.Count > 0) | Assert.IsNotEmpty(list) |
Assert.IsTrue(list.Count == 0) | Assert.IsEmpty(list) |
Assert.IsTrue(list.Count() == 3) | Assert.HasCount(3, list) |
Assert.IsTrue(x != null) | Assert.IsNotNull(x) |
Assert.IsTrue(x == null) | Assert.IsNull(x) |
Assert.AreEqual(a, b) for same instance | Assert.AreSame(a, b) -- reference identity |
Assert.IsTrue(!list.Contains(item)) | Assert.DoesNotContain(item, list) |
list.Single(predicate) + Assert.IsNotNull | Assert.ContainsSingle(list) |
Assert.IsTrue(list.Contains(item)) | Assert.Contains(item, list) |
Assert.Contains("expected", actualString);
Assert.StartsWith("prefix", actualString);
Assert.EndsWith("suffix", actualString);
Assert.MatchesRegex(@"\d{3}-\d{4}", phoneNumber);// MSTest 3.x -- out parameter
Assert.IsInstanceOfType<MyHandler>(result, out var typed);
typed.Handle();
// MSTest 4.x -- returns directly
var typed = Assert.IsInstanceOfType<MyHandler>(result);Assert.IsGreaterThan(lowerBound, actual);
Assert.IsLessThan(upperBound, actual);
Assert.IsInRange(actual, low, high);[TestMethod]
[DataRow(1, 2, 3)]
[DataRow(0, 0, 0, DisplayName = "Zeros")]
[DataRow(-1, 1, 0)]
public void Add_ReturnsExpectedSum(int a, int b, int expected)
{
Assert.AreEqual(expected, Calculator.Add(a, b));
}Prefer ValueTuple return types over IEnumerable<object[]> for type safety:
[TestMethod]
[DynamicData(nameof(DiscountTestData))]
public void ApplyDiscount_ReturnsExpectedPrice(decimal price, int percent, decimal expected)
{
var result = PriceCalculator.ApplyDiscount(price, percent);
Assert.AreEqual(expected, result);
}
// ValueTuple -- preferred (MSTest 3.7+)
public static IEnumerable<(decimal price, int percent, decimal expected)> DiscountTestData =>
[
(100m, 10, 90m),
(200m, 25, 150m),
(50m, 0, 50m),
];When you need metadata per test case, use TestDataRow<T>:
public static IEnumerable<TestDataRow<(decimal price, int percent, decimal expected)>> DiscountTestDataWithMetadata =>
[
new((100m, 10, 90m)) { DisplayName = "10% discount" },
new((200m, 25, 150m)) { DisplayName = "25% discount" },
new((50m, 0, 50m)) { DisplayName = "No discount" },
];readonly fields and works correctly with nullability analyzers (fields are guaranteed non-null after construction)[TestInitialize] only for async initialization, combined with the constructor for sync parts[TestCleanup] for cleanup that must run even on failureTestContext via constructor (MSTest 3.6+)[TestClass]
public sealed class RepositoryTests
{
private readonly TestContext _testContext;
private readonly FakeDatabase _db; // readonly -- guaranteed by constructor
public RepositoryTests(TestContext testContext)
{
_testContext = testContext;
_db = new FakeDatabase(); // sync init in ctor
}
[TestInitialize]
public async Task InitAsync()
{
// Use TestInitialize ONLY for async setup
await _db.SeedAsync();
}
[TestCleanup]
public void Cleanup() => _db.Reset();
}[AssemblyInitialize] -- once per assembly[ClassInitialize] -- once per classTestContext property injection: Constructor -> set TestContext property -> [TestInitialize]TestContext: Constructor (receives TestContext) -> [TestInitialize][TestCleanup] -> DisposeAsync -> Dispose -- per test[ClassCleanup] -- once per class[AssemblyCleanup] -- once per assemblyAlways use TestContext.CancellationToken with [Timeout]:
[TestMethod]
[Timeout(5000)]
public async Task FetchData_ReturnsWithinTimeout()
{
var result = await _client.GetDataAsync(_testContext.CancellationToken);
Assert.IsNotNull(result);
}Use only for genuinely flaky external dependencies (network, file system), not to paper over race conditions or shared state issues.
[TestMethod]
[Retry(3)]
public void ExternalService_EventuallyResponds() { }[TestMethod]
[OSCondition(OperatingSystems.Windows)]
public void WindowsRegistry_ReadsValue() { }
[TestMethod]
[CICondition(ConditionMode.Exclude)]
public void LocalOnly_InteractiveTest() { }[assembly: Parallelize(Workers = 4, Scope = ExecutionScope.MethodLevel)]
[TestClass]
[DoNotParallelize] // Opt out specific classes
public sealed class DatabaseIntegrationTests { }© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/writing-mstest-tests of microsoft/testfx.
Open the folder on GitHubat commit 19d717a
Writing Mstest Tests 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Writing Mstest Tests this skillmicrosoft/testfx | 1k | — | ~3.1k | Automated safety check: Pass | MIT | |
| New Event Sourceaws/aws-lambda-dotnet | 1.7k | — | ~3k | Automated safety check: Pass | Apache-2.0 | |
| ScottPlot Test RunnerScottPlot/ScottPlot | 6.8k | — | ~308 | Automated safety check: Pass | MIT | |
| Aspire Integration TestingDevBetterCom/DevBetterWeb | 157 | 2 repos | ~2.3k | Automated safety check: Pass | None | |
| Vstest Build Testmicrosoft/vstest | 969 | — | ~1.9k | Automated safety check: Pass | MIT | |
| Coverage Analysisrunceel/ReactiveProperty | 944 | — | ~5.9k | Automated safety check: Warn | MIT |
aws/aws-lambda-dotnet
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…
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…
DevBetterCom/DevBetterWeb
Write integration tests using .NET Aspire's testing facilities with xUnit.
microsoft/vstest
Build, test, and validate changes in the vstest repository. An agent skill from microsoft/vstest.
runceel/ReactiveProperty
Automated, project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects with existing unit tests.
OpenCoreMMO/OpenCoreMMO
Write, fix, or review NeoServer unit tests using xUnit and FluentAssertions.
microsoft/testfx
Guide for organizing MSBuild infrastructure with Directory.Build.props, Directory.Build.targets, Directory.Packages.props, and Directory.Build.rsp.
microsoft/testfx
Project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects.
microsoft/testfx
Guide for optimizing MSBuild incremental builds. An agent skill from microsoft/testfx.
microsoft/testfx
Validate TestFx shipping paths and capable CI execution using packed consumers, package/cache provenance, exact exits and artifacts, and selected-versus-executed test evidence.
microsoft/testfx
Guide for modernizing and migrating MSBuild project files to SDK-style format.
microsoft/testfx
Guide for interpreting ResolveProjectReferences time in MSBuild performance summaries.
Works with
Categories
Write new MSTest unit tests and fix existing MSTest code using MSTest 3.x/4.x modern APIs and best practices. Writing Mstest Tests is an agent skill from microsoft/testfx, published by the product's own GitHub organization.x modern APIs and best practices.
Writing Mstest Tests fits situations like: create MSTest unit tests; modernize MSTest assertions; better MSTest assertion than Assert.IsTrue; replace hard cast with MSTest type assertion.
Run `npx skills add microsoft/testfx --skill writing-mstest-tests -a claude-code`. Or copy the skill folder (.agents/skills/writing-mstest-tests in microsoft/testfx) into .claude/skills/writing-mstest-tests in your project. Claude Code loads it when a task matches its description.
Run `npx skills add microsoft/testfx --skill writing-mstest-tests -a codex`. Or copy the skill folder (.agents/skills/writing-mstest-tests in microsoft/testfx) into .agents/skills/writing-mstest-tests in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/testfx --skill writing-mstest-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/writing-mstest-tests, .gemini/skills/writing-mstest-tests, .github/skills/writing-mstest-tests and .opencode/skills/writing-mstest-tests in your project.
SKILL.md names no scripts, command-line tools or credentials: Writing Mstest Tests is instructions for the agent only.
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.
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.
Writing Mstest Tests is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Writing Mstest Tests: 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.
microsoft (a GitHub organization, an official publisher) maintains it in microsoft/testfx, which has 1,047 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on October 9, 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.