home/categories/testing/dotnet-skills-plugins-dotnet-test-skills-writing-mstest-tests-skill-md
testingtesting-security

writing-mstest-tests

Best practices for writing MSTest 3.x/4.x unit tests. Use when the user needs to write, improve, fix, or review MSTest tests, including modern assertions, data-driven tests, test lifecycle, and common anti-patterns. Also use when fixing test issues like swapped Assert.AreEqual arguments, incorrect assertion usage, or modernizing legacy test code. Covers MSTest.Sdk, sealed classes, Assert.Throws, DynamicData with ValueTuples, TestContext, and conditional execution.

dotnet
maintainer
dotnet
更新於 3/30/2026
星標
1022
分支
77
quick start

Installation and usage

Best practices for writing MSTest 3.x/4.x unit tests. Use when the user needs to write, improve, fix, or review MSTest tests, including modern assertions, data-driven tests, test lifecycle, and common anti-patterns. Also use when fixing test issues like swapped Assert.AreEqual arguments, incorrect assertion usage, or modernizing legacy test code. Covers MSTest.Sdk, sealed classes, Assert.Throws, DynamicData with ValueTuples, TestContext, and conditional execution.

安裝
$ install --globalskills.sh
使用

安裝後,您可以通過在終端運行以下命令來使用此技能:

skills use writing-mstest-tests