본문으로 건너뛰기
Skillpedia
테스트5.8k · #14622

migrate-xunit-to-xunit-v3

하는 일

이 스킬은 .NET 테스트 프로젝트를 xUnit.net v2에서 xUnit 테스트 라이브러리의 새 버전인 xunit.v3로 업그레이드합니다. v3로 옮긴 뒤 테스트가 컴파일되지 않거나 다르게 동작하는 팀을 위한 스킬입니다.

사용하는 경우

  • ✓테스트 프로젝트가 xunit v2 패키지를 참조하고 xunit.v3로 옮겨야 할 때.
  • ✓xunit 패키지를 버전 3으로 올린 뒤 컴파일 오류가 나타날 때.
  • ✓업그레이드 후 사용자 정의 테스트 특성이나 비동기 테스트가 깨질 때.

스킬 링크

https://github.com/dotnet/skills/blob/main/plugins/dotnet-test-migration/skills/migrate-xunit-to-xunit-v3/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet-test-migration/skills/migrate-xunit-to-xunit-v3/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 xUnit v2 테스트 프로젝트를 xunit.v3로 올리고, 빌드를 막는 것은 모두 고쳐 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 패키지 참조와 프로젝트 설정을 업데이트하고, v3가 요구하는 소스 변경을 고치며, 테스트를 실행해 결과가 맞는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

xunit.v3 Migration

Migrate .NET test projects from xUnit.net v2 to xUnit.net v3. The outcome is a solution where all test projects reference xunit.v3.* packages, compiles cleanly, and all tests pass with the same results as before migration.

When to Use

  • Upgrading test projects from xunit (v2) packages to xunit.v3
  • Resolving compilation errors after updating xunit package references to v3

When Not to Use

  • Migrating between test frameworks (e.g., MSTest or NUnit to xUnit.net) — different effort entirely
  • Migrating from VSTest to Microsoft.Testing.Platform — use migrate-vstest-to-mtp
  • The projects already reference xunit.v3 — migration is done

Inputs

Input Required Description
Test project or solution No Discover .csproj, .sln, .slnx, central props, and source in the current working directory; ask only if none are found or the target is ambiguous

Workspace and Completion Contract

  • Skill activation is not completion. For migrate/fix/update requests, inspect the staged files, edit them, and run tests in the same task.
  • The skill base directory contains only guidance. Search the current working directory and open paths exactly as returned.
  • If a tool rejects a searched path, classify the rejection before retrying. Only a positively confirmed reader/path-normalization limitation with authorized access permits retrying through another permitted reader/editor.
  • On a permission, policy, or content-exclusion denial, stop that path and report the blocker. Never bypass the denial through other tools, shell commands, aliases, or agents, or infer or reconstruct the restricted content.
  • If the rejection reason is unclear, treat the path as unavailable, not missing. Continue only independently permitted work and explicitly disclose the incomplete migration.
  • Do not ask the user to provide a path while workspace discovery can find it.
  • Inventory project/central package files and all affected source in one pass. A package-only migration is incomplete when v2-only APIs remain.
  • End with the detected source version and runner, exact package compatibility set, files changed, discovered/passed/failed/skipped counts, and any platform-specific result. A build without test discovery is not success.
  • Package validity is empirical: record the configured feed query or resolved package graph and a successful restore. In the final result, say how the selected exact versions were proven available; do not merely name a version and leave a judge or user to infer whether it exists.

Workflow

Commit strategy: Do not create commits unless the user asks. Keep project configuration and source edits logically separable in the diff, but finish and verify the whole requested migration.

Prioritization: Steps 1-5 are required for every migration. Steps 6-12 are conditional — only apply the ones relevant to the project's code patterns. Skip steps that don't apply.

Decisions that change the result

Run this preflight before editing:

Detected state Required action
Project references xunit.v3, has the required executable/runner configuration, contains no remaining v2 packages or v2-only API patterns, and its existing test command passes Stop: migration is already complete. Do not update versions, create props files, or modify source. Report the verified no-op result. If any required v3 adaptation remains, make only that repair instead of treating the package reference alone as completion.
xUnit v2 uses YTest.MTP.XUnit2 Preserve MTP: remove that shim, set UseMicrosoftTestingPlatformRunner=true, and do not add xunit.runner.visualstudio or IsTestingPlatformApplication=false.
xUnit v2 does not use the MTP shim Preserve VSTest: keep/update xunit.runner.visualstudio and set IsTestingPlatformApplication=false.
A custom type derives from BeforeAfterTestAttribute Preserve that inheritance and its behavior. Add the IXunitTest parameter to both overrides and pass it to base.Before/base.After; do not replace the subclass with a direct interface implementation.
A Type-based collection/orderer attribute points to a custom type Migrate both the attribute syntax and the referenced type's v3 contract. For a collection factory, implement the required xUnit v3 IXunitTestCollectionFactory behavior; compiling the attribute while leaving an empty factory is not
자주 묻는 질문

테스트 결과가 그대로 유지되나요?

목표는 업그레이드 전과 같은 결과이며, 스킬이 테스트를 실행해 이를 확인합니다.

테스트 플랫폼도 바꾸나요?

아니요. 기존 실행기를 유지하며, Microsoft.Testing.Platform으로의 전환은 별도의 스킬입니다.

MSTest나 NUnit에서 옮기는 것도 다루나요?

아니요. 프레임워크 간 이동은 다르고 더 큰 작업입니다.

상세 정보

작성자의 원본 설명

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest attributes, Xunit.SkippableFact, xunit.abstractions/extensibility consolidation, and Xunit.Combinatorial/StaFact compatibility. Do not use for framework conversion or a runner-only migration. For xUnit v3 MTP filter syntax, also use migrate-vstest-to-mtp.

repo: dotnet/skills

인기도

GitHub 스타
5.8k
순위
#14622
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬