Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Mstest Skill

ASecurity

Generates MSTest tests in C#. Microsoft's built-in testing framework for .NET. Use when user mentions "MSTest", "[TestMethod]", "[TestClass]", "Assert.AreEqual". Triggers on: "MSTest", "[TestMethod]", "[TestClass]", "Microsoft test framework".

36 stars
0 votes
0 copies
0 views
Added 9/22/2026
devopsgoc#testingdebugginggitapici/cd

Works with

api

Security Analysis

A100/100

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add NVlabs/Skill2Env --skill mstest-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mstest Skill?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Mstest Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nvlabs-mstest-skill/badge)](https://www.skillsdirectory.com/skills/nvlabs-mstest-skill)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: mstest-skill
description: >
  Generates MSTest tests in C#. Microsoft's built-in testing framework for .NET.
  Use when user mentions "MSTest", "[TestMethod]", "[TestClass]",
  "Assert.AreEqual". Triggers on: "MSTest", "[TestMethod]", "[TestClass]",
  "Microsoft test framework".
languages:
  - C#
category: unit-testing
license: MIT
metadata:
  author: TestMu AI
  version: "1.0"
---

# MSTest Testing Skill

## Core Patterns

### Basic Test

```csharp
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public class CalculatorTests
{
    private Calculator _calc;

    [TestInitialize]
    public void SetUp() => _calc = new Calculator();

    [TestMethod]
    public void Add_TwoNumbers_ReturnsSum()
    {
        Assert.AreEqual(5, _calc.Add(2, 3));
    }

    [TestMethod]
    [ExpectedException(typeof(DivideByZeroException))]
    public void Divide_ByZero_Throws()
    {
        _calc.Divide(10, 0);
    }
}
```

### Data-Driven Tests

```csharp
[DataTestMethod]
[DataRow(2, 3, 5)]
[DataRow(-1, 1, 0)]
[DataRow(0, 0, 0)]
public void Add_Parameterized(int a, int b, int expected)
{
    Assert.AreEqual(expected, _calc.Add(a, b));
}

[DataTestMethod]
[DynamicData(nameof(GetTestData), DynamicDataSourceType.Method)]
public void Add_DynamicData(int a, int b, int expected)
{
    Assert.AreEqual(expected, _calc.Add(a, b));
}

private static IEnumerable<object[]> GetTestData()
{
    yield return new object[] { 1, 2, 3 };
    yield return new object[] { 10, -5, 5 };
}
```

### Assertions

```csharp
Assert.AreEqual(expected, actual);
Assert.AreNotEqual(unexpected, actual);
Assert.IsTrue(condition);
Assert.IsFalse(condition);
Assert.IsNull(obj);
Assert.IsNotNull(obj);
Assert.IsInstanceOfType(obj, typeof(MyClass));
Assert.ThrowsException<ArgumentException>(() => Method());
CollectionAssert.Contains(list, item);
CollectionAssert.AreEquivalent(expected, actual);
StringAssert.Contains(str, "substring");
StringAssert.StartsWith(str, "prefix");
StringAssert.Matches(str, new Regex(@"\d+"));
```

### Lifecycle

```
[AssemblyInitialize]  → Once per assembly (static)
[ClassInitialize]     → Once per class (static)
[TestInitialize]      → Before each test
[TestMethod]          → Test
[TestCleanup]         → After each test
[ClassCleanup]        → Once after class (static)
[AssemblyCleanup]     → Once after assembly (static)
```

### Categories

```csharp
[TestMethod, TestCategory("Smoke")]
public void QuickTest() { }

[TestMethod, Ignore("Bug #456")]
public void SkippedTest() { }

[TestMethod, Timeout(5000)]
public void TimedTest() { }
```

## Setup: `dotnet add package MSTest.TestFramework MSTest.TestAdapter Microsoft.NET.Test.Sdk`
## Run: `dotnet test` or `dotnet test --filter "TestCategory=Smoke"`

## Deep Patterns

See `reference/playbook.md` for production-grade patterns:

| Section | What You Get |
|---------|-------------|
| §1 Project Setup | .csproj deps, .runsettings with parallel + coverage config |
| §2 Test Patterns | TestMethod, DataTestMethod, DynamicData, exception testing |
| §3 FluentAssertions | AssertionScope, async exceptions, collection assertions |
| §4 Class & Assembly Initialize | Testcontainers, shared expensive setup, global config |
| §5 WebApplicationFactory | API integration tests with in-memory DB |
| §6 Bogus Test Data | Faker patterns for realistic data generation |
| §7 TestContext & Logging | Diagnostic output, categories, timeouts |
| §8 CI/CD Integration | GitHub Actions with coverage reporting and thresholds |
| §9 Debugging Table | 12 common problems with causes and fixes |
| §10 Best Practices | 14-item production checklist |

Attribution

NVlabsNVlabs
View sourceMore from NVlabs →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Terraform Module Library

Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

397921 votes

sematext-otel

Wire a service's OpenTelemetry output to Sematext Cloud. Walks through region, App-type, instrumentation flow (managed OTLP endpoint vs Sematext Agent), and signal selection (traces/metrics/logs), then produces the exact env-var block and points at a runnable reference example in this repo. Invoke when instrumenting a new app for Sematext.

01 votes

Deployment Patterns

Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.

2648130 votes

Babysit

Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.

945230 votes

V7 Roster

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

813270 votes
View all in devops →