AgentHubAgentHub

writing-mstest-tests

SkillSkillsMP

io.github.dotnet/skills/writing-mstest-tests · vmain

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 ExpectedException with Assert.Throws, data-driven tests (DataRow, DynamicData, ValueTuples), test lifecycle (sealed classes, TestInitialize, TestCleanup), async tests and cancellation tokens, test parallelization (Parallelize / DoNotParallelize), MSTest.Sdk project setup. DO NOT USE FOR: broad test quality audits (use test-anti-patterns), running tests (use run-tests), MSTest version migration (use migrate-mstest-v1v2-to-v3 or migrate-mstest-v3-to-v4), xUnit/NUnit/TUnit, or non-.NET languages.

概览

writing-mstest-tests 是一个Agent Skill,收录自 SkillsMP。本页提供 Cursor、Claude Code 等客户端的安装配置片段。

Agent Skill 是带 SKILL.md 的指令包。安装后,AI 会根据 description 在匹配任务时自动加载,无需每次手动粘贴提示词。

安装

选择你的平台查看安装方式

# 通用 CLI(Cursor / Claude Code / Codex 等均支持)
npx skills add dotnet/skills@writing-mstest-tests

使用方式

安装完成后,在对话中直接描述你的任务(或提及技能名称)。Agent 会先读取 SKILL.md 的 description 判断是否启用,再按其中的步骤执行。可用 /skills(Claude Code)或在设置中查看已加载的 Skills。

相关资源

统一 Manifest

{
  "id": "io.github.dotnet/skills/writing-mstest-tests",
  "type": "skill",
  "version": "main",
  "displayName": "writing-mstest-tests",
  "description": "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 ExpectedException with Assert.Throws, data-driven tests (DataRow, DynamicData, ValueTuples), test lifecycle (sealed classes, TestInitialize, TestCleanup), async tests and cancellation tokens, test parallelization (Parallelize / DoNotParallelize), MSTest.Sdk project setup. DO NOT USE FOR: broad test quality audits (use test-anti-patterns), running tests (use run-tests), MSTest version migration (use migrate-mstest-v1v2-to-v3 or migrate-mstest-v3-to-v4), xUnit/NUnit/TUnit, or non-.NET languages.",
  "author": {
    "name": "dotnet",
    "url": "https://github.com/dotnet"
  },
  "repository": {
    "url": "https://github.com/dotnet/skills",
    "source": "github",
    "subfolder": "plugins/dotnet-test/skills/writing-mstest-tests"
  },
  "homepage": "https://skillsmp.com/skills/dotnet-skills-plugins-dotnet-test-skills-writing-mstest-tests-skill-md",
  "distribution": {
    "packages": [
      {
        "registryType": "source",
        "identifier": "dotnet/skills@writing-mstest-tests",
        "version": "main",
        "runtimeHint": "npx skills add"
      }
    ],
    "remotes": []
  },
  "dependencies": [],
  "installTargets": [
    "claude-code",
    "claude-desktop",
    "cursor",
    "codex",
    "vscode"
  ],
  "keywords": [
    "stars:3323"
  ],
  "provenance": {
    "origin": "skillsmp",
    "originalId": "dotnet-skills-plugins-dotnet-test-skills-writing-mstest-tests-skill-md",
    "originalUrl": "https://skillsmp.com/skills/dotnet-skills-plugins-dotnet-test-skills-writing-mstest-tests-skill-md",
    "isOfficial": false,
    "status": "active"
  }
}
writing-mstest-tests — Agent Skill 安装与配置 · AgentHub