[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CVEEEM07GA39101KYW5V2E":3,"skill-same:01M7CVEEEM07GA39101KYW5V2E":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7CVEEEM07GA39101KYW5V2E","migrate-xunit-to-mstest",null,"Convert .NET tests from xUnit.net v2\u002Fv3 to MSTest v4 while preserving VSTest or MTP. Use for replacing xunit packages, Fact\u002FTheory\u002FInlineData\u002FMemberData, assertions, IClassFixture\u002FICollectionFixture, ITestOutputHelper, TestContext cancellation, traits\u002FOwner, skips, timeouts, and xUnit parallelization. Also use when a \"convert xUnit to MSTest\" request may already be migrated: inspect and report the no-op. Do not use for xUnit v2-to-v3, MSTest upgrades, NUnit\u002FTUnit conversion, or runner-only VSTest-to-MTP migration.","deadmade\u002Fdead-agent-skills","deadmade","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F130925709?v=4","01M7CTQ65AGYR4J9K9TX0YR9V3","01M7CTQ66B4VMJFEDZP4EKKE6K",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fmigrate-xunit-to-mstest\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: migrate-xunit-to-mstest\ndescription: >\n  Convert .NET tests from xUnit.net v2\u002Fv3 to MSTest v4 while preserving VSTest\n  or MTP. Use for replacing xunit packages, Fact\u002FTheory\u002FInlineData\u002FMemberData,\n  assertions, IClassFixture\u002FICollectionFixture, ITestOutputHelper, TestContext\n  cancellation, traits\u002FOwner, skips, timeouts, and xUnit parallelization. Also\n  use when a \"convert xUnit to MSTest\" request may already be migrated: inspect\n  and report the no-op. Do not use for xUnit v2-to-v3, MSTest upgrades,\n  NUnit\u002FTUnit conversion, or runner-only VSTest-to-MTP migration.\nlicense: MIT\n---\n\n# xUnit -> MSTest Migration\n\nConvert xUnit.net v2 or v3 tests to MSTest v4 without changing the target framework or test platform. A successful migration builds, discovers the same tests, and preserves pass\u002Ffail results and execution semantics.\n\n## Scope\n\nUse this skill only when the project contains xUnit packages or source and the user wants MSTest. If the project already uses MSTest and contains no xUnit tests, report that no framework migration is needed and make no changes.\n\nDo not combine this framework conversion with a target-framework upgrade or VSTest\u002FMTP migration. Complete and verify one migration before starting another.\n\n## Workspace Contract\n\n- Continue after skill activation. Search the current working directory for the\n  staged project and source; never look for user files under this skill's base\n  directory.\n- Open the literal paths returned by glob\u002Fsearch. If one reader or patch tool\n  rejects a path that was just found, retry with another available tool. Do not\n  ask the user for a path until current-workspace discovery is exhausted.\n- Classify by the requested deliverable: \"convert this project\" means edit,\n  build, and test; \"give me a plan\" or \"how would I convert it?\" means answer.\n  Do not replace execution with \"please provide the files\" when files are present.\n- The final response must state the source xUnit version, preserved runner,\n  changed files, each high-risk semantic mapping applied, and actual test\n  counts. Assertions about fixture lifetime, Owner mapping, cancellation, or\n  parallelization must be visible in the resulting source, not only prose.\n\n## Response Mode\n\n- **Full migration request:** inspect the project, make the edits, build, and run tests. Do not stop after giving a plan.\n- **Focused compile error or API question:** inspect the relevant code and apply only that mapping. Do not narrate the entire workflow.\n- **Unsupported target framework:** stop before changing packages. MSTest v4 requires .NET 8+ or .NET Framework 4.6.2+ for test applications; offer a separately approved TFM upgrade or MSTest v3 as the intermediate target.\n\n## Decisions That Change the Result\n\nApply these before the mechanical mapping:\n\n| Detected state | Required action |\n|---|---|\n| No xUnit package, namespace, attribute, or fixture remains | Stop. Make no file changes, report that migration is unnecessary, and run the existing `dotnet test` command once to prove the already-MSTest project is healthy. |\n| Source uses VSTest | Keep the existing VSTest property\u002Fconfiguration. Prefer retaining and updating a source project's explicit `Microsoft.NET.Test.Sdk` pin; a repository that intentionally relies on the MSTest metapackage's transitive dependency may keep that convention. Do not introduce MTP properties. |\n| Source uses MTP | Replace xUnit-specific MTP selection with MSTest MTP configuration. Prefer `MSTest.Sdk`; with the metapackage, set `EnableMSTestRunner=true` and `OutputType=Exe`. Preserve native-versus-bridged command integration, and do not add `\u003CUseVSTest>true\u003C\u002FUseVSTest>` or other VSTest-only configuration. |\n| Source relies on xUnit's default parallelization | Add `[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.ClassLevel)]` to a compiled `.cs` file when the current project has at least two independently runnable test classes. In a one-class project with no explicit parallel setting, omit it because class-level concurrency is not observable. Translate explicit `CollectionBehavior` or `xunit.runner.json` settings regardless of current class count. Before reporting completion, read the changed file back and name it in the result. |\n\nFor detailed mappings and examples, search [`references\u002Fmapping-cheatsheet.md`](references\u002Fmapping-cheatsheet.md) for constructs actually present in the project and read only the matching sections. Do not load or reproduce the whole reference.\n\n## Fast Path\n\nFor a routine project migration, converge in four phases: one batched discovery read\u002Fsearch, one edit pass, one `dotnet test`, and one concise result. Do not:\n\n- list a directory and then reread the same files through another tool\n- copy project files into the loaded skill or its `references\u002F` directory; those files are read-only guidance, not an editing workspace\n- try `dotnet test --no-restore` unless restore is already known to be current\n- run separate restore, build, and test commands when `dotnet test` is sufficient\n- rerun a passing test command or inspect unchanged files for confirmation\n\nUse an existing CI\u002Ftest result as the parity baseline when available. Run a new pre-edit baseline only when counts are unavailable and the migration contains data-driven tests, fixtures, skips, custom extensions, shared state, or other behavior whose parity cannot be established from source alone.\n\n## Workflow\n\n### 1. Establish the baseline\n\n1. In one discovery pass, batch-read the test projects plus `Directory.Build.props`, `Directory.Packages.props`, `global.json`, and runner configuration, and search the source for the high-risk constructs below.\n2. State the detected source version:\n   - `xunit` 2.x and related packages -> xUnit v2\n   - `xunit.v3` or `xunit.v3.*` -> xUnit v3\n3. Identify VSTest or MTP from the project and repository configuration. Use `platform-detection` only when the platform is ambiguous, and preserve the detected platform.\n4. Record the target frameworks and stop if MSTest v4 does not support them.\n5. If the Fast Path requires a new baseline, run the existing test command once and record discovered, passed, failed, and skipped counts.\n6. Inventory high-risk constructs before editing:\n   - `IClassFixture`, `ICollectionFixture`, `CollectionDefinition`, custom `FactAttribute`\u002F`TheoryAttribute`\u002F`DataAttribute`\n   - `Assert.Throws`, `ThrowsAny`, `IsType`, `Record.Exception`, event assertions\n   - `ITestOutputHelper`, `TestContext.Current`, `IAsyncLifetime`\n   - `CollectionBehavior`, `xunit.runner.json`, shared static or external state\n\n### 2. Replace packages without switching runners\n\nRemove xUnit packages from project files and central package files. This includes `xunit*`, `xunit.v3.*`, `xunit.runner.visualstudio`, `YTest.MTP.XUnit2`, and xUnit-specific companion packages that are being replaced.\n\nDefault to the MSTest v4 metapackage for an incremental conversion:\n\n```xml\n\u003C!-- Example pin: replace with the exact stable v4 version resolved from the configured package source. -->\n\u003CPackageReference Include=\"MSTest\" Version=\"4.1.0\" \u002F>\n```\n\nThe metapackage includes `Microsoft.NET.Test.Sdk`, `MSTest.TestAdapter`, `MSTest.TestFramework`, and `MSTest.Analyzers`. When preserving VSTest, prefer retaining a source project's explicit `Microsoft.NET.Test.Sdk` pin and update it to a version compatible with the chosen MSTest version; this keeps runner\u002Fversion compatibility reviewable. A repository that intentionally relies on the metapackage's transitive dependency may preserve that convention instead. For the example pin above, MSTest 4.1.0 requires Microsoft.NET.Test.Sdk 18.0.1+; incompatible older pins can cause `NU1605`.\n\nWhen preserving MTP, do not carry xUnit's `UseMicrosoftTestingPlatformRunner` property into the MSTest project. Prefer `MSTest.Sdk` at the resolved version. If repository conventions require the metapackage route, set `\u003CEnableMSTestRunner>true\u003C\u002FEnableMSTestRunner>` and `\u003COutputType>Exe\u003C\u002FOutputType>`. Retain `TestingPlatformDotnetTestSupport=true` only for repositories that continue to invoke MTP applications through VSTest command mode; native .NET 10+ MTP mode does not require it. When preserving VSTest with `MSTest.Sdk`, set `\u003CUseVSTest>true\u003C\u002FUseVSTest>`.\n\nDo not change `TargetFramework`. Remove `xunit.runner.json` only after porting its relevant settings.\n\n### 3. Perform the mechanical conversion\n\nApply the common rewrites first:\n\n| xUnit | MSTest |\n|---|---|\n| no class attribute | `[TestClass]` |\n| `[Fact]` | `[TestMethod]` |\n| `[Theory]` + `[InlineData]` | `[TestMethod]` + `[DataRow]` |\n| `[MemberData]` | `[DynamicData]` |\n| `[Fact(Skip = \"...\")]` | `[TestMethod]` + `[Ignore(\"...\")]` |\n| `[Trait(\"Category\", value)]` | `[TestCategory(value)]` |\n| `[Trait(\"Owner\", value)]` | `[Owner(value)]` |\n| other `[Trait(key, value)]` | `[TestProperty(key, value)]` |\n| `Assert.Equal` \u002F `NotEqual` | `Assert.AreEqual` \u002F `AreNotEqual` |\n| `Assert.True` \u002F `False` | `Assert.IsTrue` \u002F `IsFalse` |\n| `Assert.Null` \u002F `NotNull` | `Assert.IsNull` \u002F `IsNotNull` |\n\nRemove `using Xunit;` and `using Xunit.Abstractions;`. Add `using Microsoft.VisualStudio.TestTools.UnitTesting;` for the metapackage option; `MSTest.Sdk` supplies it as an implicit global using.\n\nPreserve existing class inheritance. Do not mechanically seal classes.\n\n### 4. Resolve semantic mappings\n\nLoad the mapping cheatsheet for every high-risk construct found in Step 1. These rules are mandatory:\n\n- xUnit `Assert.Throws\u003CT>` is exact-type and maps to MSTest `Assert.ThrowsExactly\u003CT>`.\n- xUnit `Assert.ThrowsAny\u003CT>` permits derived types and maps to MSTest `Assert.Throws\u003CT>`.\n- xUnit `Assert.IsType\u003CT>` is exact-type and maps to the generic `Assert.IsExactInstanceOfType\u003CT>`; `Assert.IsAssignableFrom\u003CT>` maps to the generic `Assert.IsInstanceOfType\u003CT>`. When the xUnit assertion's typed return value is assigned, preserve that assignment and use the generic MSTest overload rather than a non-generic `Type` overload.\n- xUnit `Assert.Equal` on sequences compares elements. Use `Assert.AreSequenceEqual` on MSTest 4.3+ or `CollectionAssert.AreEqual` with materialized lists on earlier v4; never replace sequence equality with reference-based `Assert.AreEqual`.\n- `[Ignore]` and `[Timeout]` are modifiers; keep `[TestMethod]` so the test is discovered.\n- `[DataRow]` values must exactly match parameter types.\n- `TestContext.Current.CancellationToken` maps to an injected MSTest `TestContext.CancellationToken`; never replace it with `CancellationToken.None` or a new `CancellationTokenSource`.\n- `Owner` is a reserved VSTest property. Map `[Trait(\"Owner\", value)]` to `[Owner(value)]`, not `[TestProperty(\"Owner\", value)]`.\n- Assertions with no MSTest equivalent (`Assert.Collection`, `Assert.All`, `Assert.Equivalent`, `Record.Exception`, event assertions) require an explicit manual rewrite. Never delete an assertion without replacing its verification.\n\nApply the mechanical and semantic rewrites in one edit pass when the inventory makes the required mappings clear. Do not run an intermediate build by default; use compiler errors from final verification to drive only unresolved conversions.\n\n### 5. Preserve lifecycle, fixture scope, and parallelization\n\n- Keep constructor setup and `IDisposable`\u002F`IAsyncDisposable` when valid. Map `IAsyncLifetime` to `[TestInitialize]`\u002F`[TestCleanup]`.\n- `IClassFixture\u003CT>` means one fixture instance per test class, shared by all methods in that class. Map it to a static `T` field created once by a static `[ClassInitialize]` method that accepts `TestContext`, and dispose it once from static `[ClassCleanup]`. Never use `[TestInitialize]`\u002F`[TestCleanup]` for this mapping because that creates one fixture per test method.\n- For `ICollectionFixture\u003CT>`, preserve both sharing and serialization. Prefer a static `Lazy\u003CT>` helper used by each member class; add `[DoNotParallelize]` only when the source collection disabled parallelization. Use assembly initialization only when the fixture is genuinely assembly-wide.\n- Replace `ITestOutputHelper` with constructor-injected or property-based MSTest `TestContext`, and replace each `_output.WriteLine(...)` call with the corresponding `TestContext.WriteLine(...)`. In the final result, name both the `TestContext` injection\u002Fproperty and the `WriteLine` mapping explicitly; \"migrated output\" is not enough to demonstrate parity.\n\nxUnit runs classes in parallel by default; MSTest runs them serially. When the current project has two or more independently runnable test classes, preserve that effective behavior with:\n\n```csharp\n[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.ClassLevel)]\n```\n\nFor a one-class project with no explicit xUnit parallel setting, do not add an assembly policy: there is no class-level concurrency to preserve. Always translate explicit `CollectionBehavior` or `xunit.runner.json` settings. Never use `ExecutionScope.MethodLevel` to emulate xUnit. Before applying a fixture-scope or parallelization decision, state what the source shared or serialized and how the target preserves it.\n\n### 6. Verify parity\n\n1. Run tests once with the same platform, filter, and configuration used for the baseline. `dotnet test` builds by default; run a separate build only when needed to isolate a compilation failure.\n2. Compare discovered, passed, failed, and skipped counts.\n3. Investigate every difference before declaring completion:\n   - missing cases -> discovery attributes, `DynamicData`, or `DataRow` literal types\n   - changed exception behavior -> exact-vs-derived assertion mapping\n   - shared-state failures or large duration changes -> fixture scope and parallelization\n   - silently skipped tests -> missing `[TestMethod]` or incorrect runtime-skip conversion\n4. Confirm no xUnit package, namespace, attribute, runner configuration, or fixture interface remains unless explicitly documented for manual follow-up.\n5. After the final passing test, read back each changed file that implements a high-risk mapping, plus any runner or parallelization configuration. In the result, name the file and the exact target APIs that implement its lifecycle, data, skip, output, assertion, fixture-scope, or parallelization behavior. Preserve type arguments and member names such as `[ClassInitialize]`, `TestContext.WriteLine`, and `Assert.IsExactInstanceOfType\u003CT>`; generic claims such as \"converted attributes\" or \"migrated output\" are not evidence of parity.\n\nKeep the final response concise and outcome-focused:\n\n- **Changed:** name the files and exact high-risk mappings applied.\n- **Verified:** give the final test command and discovered\u002Fpassed\u002Ffailed\u002Fskipped counts.\n- **Preserved:** state the unchanged target framework and test platform, plus any fixture or parallelization scope decision.\n- **Remaining:** identify manual follow-up, or say none.\n\n## Completion Criteria\n\n- Current xUnit version and test platform were identified\n- xUnit packages and source constructs were converted\n- Target framework and test platform stayed unchanged\n- Fixture scope and effective parallelization decisions are explicit, including justified omission when concurrency is not observable\n- Build succeeds\n- Test discovery and result counts match the baseline\n- Any unsupported custom extension point is called out rather than approximated\n\n## Follow-up\n\nRun `migrate-vstest-to-mtp` separately if the user also wants MTP. Use `writing-mstest-tests` only after parity is established to polish the converted MSTest code.\n","# xUnit -> MSTest Migration\n\nConvert xUnit.net v2 or v3 tests to MSTest v4 without changing the target framework or test platform. A successful migration builds, discovers the same tests, and preserves pass\u002Ffail results and execution semantics.\n\n## Scope\n\nUse this skill only when the project contains xUnit packages or source and the user wants MSTest. If the project already uses MSTest and contains no xUnit tests, report that no framework migration is needed and make no changes.\n\nDo not combine this framework conversion with a target-framework upgrade or VSTest\u002FMTP migration. Complete and verify one migration before starting another.\n\n## Workspace Contract\n\n- Continue after skill activation. Search the current working directory for the\n  staged project and source; never look for user files under this skill's base\n  directory.\n- Open the literal paths returned by glob\u002Fsearch. If one reader or patch tool\n  rejects a path that was just found, retry with another available tool. Do not\n  ask the user for a path until current-workspace discovery is exhausted.\n- Classify by the requested deliverable: \"convert this project\" means edit,\n  build, and test; \"give me a plan\" or \"how would I convert it?\" means answer.\n  Do not replace execution with \"please provide the files\" when files are present.\n- The final response must state the source xUnit version, preserved runner,\n  changed files, each high-risk semantic mapping applied, and actual test\n  counts. Assertions about fixture lifetime, Owner mapping, cancellation, or\n  parallelization must be visible in the resulting source, not only prose.\n\n## Response Mode\n\n- **Full migration request:** inspect the project, make the edits, build, and run tests. Do not stop after giving a plan.\n- **Focused compile error or API question:** inspect the relevant code and apply only that mapping. Do not narrate the entire workflow.\n- **Unsupported target framework:** stop before changing packages. MSTest v4 requires .NET 8+ or .NET Framework 4.6.2+ for test applications; offer a separately approved TFM upgrade or MSTest v3 as the intermediate target.\n\n## Decisions That Change the Result\n\nApply these before the mechanical mapping:\n\n| Detected state | Required action |\n|---|---|\n| No xUnit package, namespace, attribute, or fixture remains | Stop. Make no file changes, report that migration is unnecessary, and run the existing `dotnet test` command once to prove the already-MSTest project is healthy. |\n| Source uses VSTest | Keep the existing VSTest property\u002Fconfiguration. Prefer retaining and updating a source project's explicit `Microsoft.NET.Test.Sdk` pin; a repository that intentionally relies on the MSTest metapackage's transitive dependency may keep that convention. Do not introduce MTP properties. |\n| Source uses MTP | Replace xUnit-specific MTP selection with MSTest MTP configuration. Prefer `MSTest.Sdk`; with the metapackage, set `EnableMSTestRunner=true` and `OutputType=Exe`. Preserve native-versus-bridged command integration, and do not add `\u003CUseVSTest>true\u003C\u002FUseVSTest>` or other VSTest-only configuration. |\n| Source relies on xUnit's default parallelization | Add `[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.ClassLevel)]` to a compiled `.cs` file when the current project has at least two independently runnable test classes. In a one-class project with no explicit parallel setting, omit it because class-level concurrency is not observable. Translate explicit `CollectionBehavior` or `xunit.runner.json` settings regardless of current class count. Before reporting completion, read the changed file back and name it in the result. |\n\nFor detailed mappings and examples, search [`references\u002Fmapping-cheatsheet.md`](references\u002Fmapping-cheatsheet.md) for constructs actually present in the project and read only the matching sections. Do not load or reproduce the whole reference.\n\n## Fast Path\n\nFor a routine project migration, converge in four phases: one batched discovery read\u002Fsearch, one edit pass, one `dotnet test`, and one concise result. Do not:\n\n- list a directory and then reread the same files through another tool\n- copy project files into the loaded skill or its `references\u002F` directory; those files are read-only guidance, not an editing workspace\n- try `dotnet test --no-restore` unless restore is already known to be current\n- run separate restore, build, and test commands when `dotnet test` is sufficient\n- rerun a passing test command or inspect unchanged files for confirmation\n\nUse an existing CI\u002Ftest result as the parity baseline when available. Run a new pre-edit baseline only when counts are unavailable and the migration contains data-driven tests, fixtures, skips, custom extensions, shared state, or other behavior whose parity cannot be established from source alone.\n\n## Workflow\n\n### 1. Establish the baseline\n\n1. In one discovery pass, batch-read the test projects plus `Directory.Build.props`, `Directory.Packages.props`, `global.json`, and runner configuration, and search the source for the high-risk constructs below.\n2. State the detected source version:\n   - `xunit` 2.x and related packages -> xUnit v2\n   - `xunit.v3` or `xunit.v3.*` -> xUnit v3\n3. Identify VSTest or MTP from the project and repository configuration. Use `platform-detection` only when the platform is ambiguous, and preserve the detected platform.\n4. Record the target frameworks and stop if MSTest v4 does not support them.\n5. If the Fast Path requires a new baseline, run the existing test command once and record discovered, passed, failed, and skipped counts.\n6. Inventory high-risk constructs before editing:\n   - `IClassFixture`, `ICollectionFixture`, `CollectionDefinition`, custom `FactAttribute`\u002F`TheoryAttribute`\u002F`DataAttribute`\n   - `Assert.Throws`, `ThrowsAny`, `IsType`, `Record.Exception`, event assertions\n   - `ITestOutputHelper`, `TestContext.Current`, `IAsyncLifetime`\n   - `CollectionBehavior`, `xunit.runner.json`, shared static or external state\n\n### 2. Replace packages without switching runners\n\nRemove xUnit packages from project files and central package files. This includes `xunit*`, `xunit.v3.*`, `xunit.runner.visualstudio`, `YTest.MTP.XUnit2`, and xUnit-specific companion packages that are being replaced.\n\nDefault to the MSTest v4 metapackage for an incremental conversion:\n\n```xml\n\u003C!-- Example pin: replace with the exact stable v4 version resolved from the configured package source. -->\n\u003CPackageReference Include=\"MSTest\" Version=\"4.1.0\" \u002F>\n```\n\nThe metapackage includes `Microsoft.NET.Test.Sdk`, `MSTest.TestAdapter`, `MSTest.TestFramework`, and `MSTest.Analyzers`. When preserving VSTest, prefer retaining a source project's explicit `Microsoft.NET.Test.Sdk` pin and update it to a version compatible with the chosen MSTest version; this keeps runner\u002Fversion compatibility reviewable. A repository that intentionally relies on the metapackage's transitive dependency may preserve that convention instead. For the example pin above, MSTest 4.1.0 requires Microsoft.NET.Test.Sdk 18.0.1+; incompatible older pins can cause `NU1605`.\n\nWhen preserving MTP, do not carry xUnit's `UseMicrosoftTestingPlatformRunner` property into the MSTest project. Prefer `MSTest.Sdk` at the resolved version. If repository conventions require the metapackage route, set `\u003CEnableMSTestRunner>true\u003C\u002FEnableMSTestRunner>` and `\u003COutputType>Exe\u003C\u002FOutputType>`. Retain `TestingPlatformDotnetTestSupport=true` only for repositories that continue to invoke MTP applications through VSTest command mode; native .NET 10+ MTP mode does not require it. When preserving VSTest with `MSTest.Sdk`, set `\u003CUseVSTest>true\u003C\u002FUseVSTest>`.\n\nDo not change `TargetFramework`. Remove `xunit.runner.json` only after porting its relevant settings.\n\n### 3. Perform the mechanical conversion\n\nApply the common rewrites first:\n\n| xUnit | MSTest |\n|---|---|\n| no class attribute | `[TestClass]` |\n| `[Fact]` | `[TestMethod]` |\n| `[Theory]` + `[InlineData]` | `[TestMethod]` + `[DataRow]` |\n| `[MemberData]` | `[DynamicData]` |\n| `[Fact(Skip = \"...\")]` | `[TestMethod]` + `[Ignore(\"...\")]` |\n| `[Trait(\"Category\", value)]` | `[TestCategory(value)]` |\n| `[Trait(\"Owner\", value)]` | `[Owner(value)]` |\n| other `[Trait(key, value)]` | `[TestProperty(key, value)]` |\n| `Assert.Equal` \u002F `NotEqual` | `Assert.AreEqual` \u002F `AreNotEqual` |\n| `Assert.True` \u002F `False` | `Assert.IsTrue` \u002F `IsFalse` |\n| `Assert.Null` \u002F `NotNull` | `Assert.IsNull` \u002F `IsNotNull` |\n\nRemove `using Xunit;` and `using Xunit.Abstractions;`. Add `using Microsoft.VisualStudio.TestTools.UnitTesting;` for the metapackage option; `MSTest.Sdk` supplies it as an implicit global using.\n\nPreserve existing class inheritance. Do not mechanically seal classes.\n\n### 4. Resolve semantic mappings\n\nLoad the mapping cheatsheet for every high-risk construct found in Step 1. These rules are mandatory:\n\n- xUnit `Assert.Throws\u003CT>` is exact-type and maps to MSTest `Assert.ThrowsExactly\u003CT>`.\n- xUnit `Assert.ThrowsAny\u003CT>` permits derived types and maps to MSTest `Assert.Throws\u003CT>`.\n- xUnit `Assert.IsType\u003CT>` is exact-type and maps to the generic `Assert.IsExactInstanceOfType\u003CT>`; `Assert.IsAssignableFrom\u003CT>` maps to the generic `Assert.IsInstanceOfType\u003CT>`. When the xUnit assertion's typed return value is assigned, preserve that assignment and use the generic MSTest overload rather than a non-generic `Type` overload.\n- xUnit `Assert.Equal` on sequences compares elements. Use `Assert.AreSequenceEqual` on MSTest 4.3+ or `CollectionAssert.AreEqual` with materialized lists on earlier v4; never replace sequence equality with reference-based `Assert.AreEqual`.\n- `[Ignore]` and `[Timeout]` are modifiers; keep `[TestMethod]` so the test is discovered.\n- `[DataRow]` values must exactly match parameter types.\n- `TestContext.Current.CancellationToken` maps to an injected MSTest `TestContext.CancellationToken`; never replace it with `CancellationToken.None` or a new `CancellationTokenSource`.\n- `Owner` is a reserved VSTest property. Map `[Trait(\"Owner\", value)]` to `[Owner(value)]`, not `[TestProperty(\"Owner\", value)]`.\n- Assertions with no MSTest equivalent (`Assert.Collection`, `Assert.All`, `Assert.Equivalent`, `Record.Exception`, event assertions) require an explicit manual rewrite. Never delete an assertion without replacing its verification.\n\nApply the mechanical and semantic rewrites in one edit pass when the inventory makes the required mappings clear. Do not run an intermediate build by default; use compiler errors from final verification to drive only unresolved conversions.\n\n### 5. Preserve lifecycle, fixture scope, and parallelization\n\n- Keep constructor setup and `IDisposable`\u002F`IAsyncDisposable` when valid. Map `IAsyncLifetime` to `[TestInitialize]`\u002F`[TestCleanup]`.\n- `IClassFixture\u003CT>` means one fixture instance per test class, shared by all methods in that class. Map it to a static `T` field created once by a static `[ClassInitialize]` method that accepts `TestContext`, and dispose it once from static `[ClassCleanup]`. Never use `[TestInitialize]`\u002F`[TestCleanup]` for this mapping because that creates one fixture per test method.\n- For `ICollectionFixture\u003CT>`, preserve both sharing and serialization. Prefer a static `Lazy\u003CT>` helper used by each member class; add `[DoNotParallelize]` only when the source collection disabled parallelization. Use assembly initialization only when the fixture is genuinely assembly-wide.\n- Replace `ITestOutputHelper` with constructor-injected or property-based MSTest `TestContext`, and replace each `_output.WriteLine(...)` call with the corresponding `TestContext.WriteLine(...)`. In the final result, name both the `TestContext` injection\u002Fproperty and the `WriteLine` mapping explicitly; \"migrated output\" is not enough to demonstrate parity.\n\nxUnit runs classes in parallel by default; MSTest runs them serially. When the current project has two or more independently runnable test classes, preserve that effective behavior with:\n\n```csharp\n[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.ClassLevel)]\n```\n\nFor a one-class project with no explicit xUnit parallel setting, do not add an assembly policy: there is no class-level concurrency to preserve. Always translate explicit `CollectionBehavior` or `xunit.runner.json` settings. Never use `ExecutionScope.MethodLevel` to emulate xUnit. Before applying a fixture-scope or parallelization decision, state what the source shared or serialized and how the target preserves it.\n\n### 6. Verify parity\n\n1. Run tests once with the same platform, filter, and configuration used for the baseline. `dotnet test` builds by default; run a separate build only when needed to isolate a compilation failure.\n2. Compare discovered, passed, failed, and skipped counts.\n3. Investigate every difference before declaring completion:\n   - missing cases -> discovery attributes, `DynamicData`, or `DataRow` literal types\n   - changed exception behavior -> exact-vs-derived assertion mapping\n   - shared-state failures or large duration changes -> fixture scope and parallelization\n   - silently skipped tests -> missing `[TestMethod]` or incorrect runtime-skip conversion\n4. Confirm no xUnit package, namespace, attribute, runner configuration, or fixture interface remains unless explicitly documented for manual follow-up.\n5. After the final passing test, read back each changed file that implements a high-risk mapping, plus any runner or parallelization configuration. In the result, name the file and the exact target APIs that implement its lifecycle, data, skip, output, assertion, fixture-scope, or parallelization behavior. Preserve type arguments and member names such as `[ClassInitialize]`, `TestContext.WriteLine`, and `Assert.IsExactInstanceOfType\u003CT>`; generic claims such as \"converted attributes\" or \"migrated output\" are not evidence of parity.\n\nKeep the final response concise and outcome-focused:\n\n- **Changed:** name the files and exact high-risk mappings applied.\n- **Verified:** give the final test command and discovered\u002Fpassed\u002Ffailed\u002Fskipped counts.\n- **Preserved:** state the unchanged target framework and test platform, plus any fixture or parallelization scope decision.\n- **Remaining:** identify manual follow-up, or say none.\n\n## Completion Criteria\n\n- Current xUnit version and test platform were identified\n- xUnit packages and source constructs were converted\n- Target framework and test platform stayed unchanged\n- Fixture scope and effective parallelization decisions are explicit, including justified omission when concurrency is not observable\n- Build succeeds\n- Test discovery and result counts match the baseline\n- Any unsupported custom extension point is called out rather than approximated\n\n## Follow-up\n\nRun `migrate-vstest-to-mtp` separately if the user also wants MTP. Use `writing-mstest-tests` only after parity is established to polish the converted MSTest code.\n",{"name":5,"license":14,"description":23},"Convert .NET tests from xUnit.net v2\u002Fv3 to MSTest v4 while preserving VSTest or MTP. Use for replacing xunit packages, Fact\u002FTheory\u002FInlineData\u002FMemberData, assertions, IClassFixture\u002FICollectionFixture, ITestOutputHelper, TestContext cancellation, traits\u002FOwner, skips, timeouts, and xUnit parallelization. Also use when a \"convert xUnit to MSTest\" request may already be migrated: inspect and report the no-op. Do not use for xUnit v2-to-v3, MSTest upgrades, NUnit\u002FTUnit conversion, or runner-only VSTest-to-MTP migration.\n","main","ccab8dffc0ecc173838f51e4c5f0d3b51a704f41","plugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fmigrate-xunit-to-mstest","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills","https:\u002F\u002Fgithub.com\u002Fdeadmade","https:\u002F\u002Fdeadmade.github.io\u002F","Blood, an Ocean of blood","2026-11-14 02:03:31",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add deadmade\u002Fdead-agent-skills --skill migrate-xunit-to-mstest",{"tool":38,"command":39},"bunx","bunx skills add deadmade\u002Fdead-agent-skills --skill migrate-xunit-to-mstest",{"tool":41,"command":42},"pnpm","pnpm dlx skills add deadmade\u002Fdead-agent-skills --skill migrate-xunit-to-mstest","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fmigrate-xunit-to-mstest\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fmapping-cheatsheet.md","REFERENCE","参考文档",28043,"https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fmigrate-xunit-to-mstest\u002Freferences\u002Fmapping-cheatsheet.md",[53,60,69,77,84,91],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":18},"01M7CVRBFTXSTTQ7F5P6PJEFYA","rust-best-practices","Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Frust-skills\u002Fskills\u002Frust-best-practices\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":64,"licenseFileUrl":65,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M7CVR0W7B8EGTNPSPA7FPC4Z","postgres-database-migration","Use this skill for planning, testing, and safely executing PostgreSQL schema migrations — especially when working with production data or shared databases.\n\n**Trigger when user asks to:**\n- Test a schema migration before applying it to production\n- Add, remove, or rename columns safely on a live table\n- Change a column's data type without downtime\n- Add or drop indexes, constraints, or foreign keys on large tables\n- Understand which ALTER TABLE operations lock the table\n- Roll back a failed migration\n- Plan a zero-downtime migration strategy\n- Fork a database to test a migration safely\n\nCovers: lock-level reference for every common DDL operation, safe migration patterns, fork-based testing, zero-downtime column changes, index creation, constraint addition, backfill strategies, pre\u002Fpost-migration validation, and rollback planning.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-database-migration\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-database-migration\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":64,"licenseFileUrl":73,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M7CVQWK20ASAZN5VETZC8J99","postgres-best-practices","Best practices and guidelines for working with Postgres. Covers schema design, indexing strategies, query optimization, migrations, and common pitfalls. Use when writing SQL, designing database schemas, optimizing queries, or setting up a Postgres database.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-best-practices\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-best-practices\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7CVQ5CY7AQHY7A2Y99RE6A7","writing-mstest-tests","ALWAYS USE when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M7CVPWJZ63GB0810F0SCGZ1K","winforms-expert","Create, modify, debug, or review Windows Forms applications only when the request contains a concrete Windows Forms marker. USE FOR: WinForms, Windows Forms, System.Windows.Forms, WinForms Form or UserControl designer files (*.Designer.cs or *.Designer.vb), Visual Studio WinForms Designer, TableLayoutPanel, BindingSource, DataGridView, Control.InvokeAsync, component-tray ownership, or custom control serialization. DO NOT USE FOR: WPF or WPF XAML, including Window.InputBindings, KeyBinding, commands, or DataContext; .NET MAUI; Avalonia; or any request where none of the listed Windows Forms markers is present.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fwinforms-expert\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":18},"01M7CVPR0QFZ1HMJ6GZRBQAQ7W","vectorization","Design, implement, optimize, and review SIMD code in .NET. USE FOR: vectorizing scalar loops with TensorPrimitives, Vector64\u002F128\u002F256\u002F512, or platform hardware intrinsics; reviewing existing SIMD code, including the generic Vector type, for contract equivalence, tail handling, memory safety, portability, fallbacks, and measured performance. DO NOT USE FOR: performance work unrelated to SIMD or vectorization.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fvectorization\u002FSKILL.md",[],[]]