
The csharp-mstest skill guides C# developers in writing unit tests using MSTest 3.x/4.x by providing best practices for test structure, lifecycle management, and modern assertion APIs. It addresses the need for consistent, maintainable test code by establishing conventions for project setup, naming patterns, initialization strategies, and proper use of MSTest's assertion classes. Developers building .NET applications can use this skill to implement effective unit testing practices aligned with current MSTest standards.
$ npx -y skills add github/awesome-copilot --skill csharp-mstest --agent claude-codeInstalls into .claude/skills of the current project.
Your goal is to help me write effective unit tests with modern MSTest, using current APIs and best practices.
[ProjectName].Testsdotnet test[TestClass] attribute for test classes[TestMethod] for test methods (prefer over [DataTestMethod])MethodName_Scenario_ExpectedBehavior[TestClass]
public sealed class CalculatorTests
{
[TestMethod]
public void Add_TwoPositiveNumbers_ReturnsSum()
{
// Arrange
var calculator = new Calculator();
// Act
var result = calculator.Add(2, 3);
// Assert
Assert.AreEqual(5, result);
}
}
Sponsors