Skip to content

Move test projects to xUnit v3 (#4671) - #4686

Open
SkyDevLab wants to merge 1 commit into
LuckyPennySoftware:mainfrom
SkyDevLab:migrate-xunit-v3
Open

SkyDevLab wants to merge 1 commit into
LuckyPennySoftware:mainfrom
SkyDevLab:migrate-xunit-v3

Conversation

@SkyDevLab

Copy link
Copy Markdown

Closes #4671

Summary of Changes

This PR migrates the test projects in AutoMapper from xUnit v2 to xUnit v3, fulfilling all items in Jimmy Bogard's checklist in #4671:

  • Migrate to xUnit v3:
    • Updated Directory.Packages.props to reference xunit.v3 (4.0.3) and xunit.runner.visualstudio (4.0.1).
    • Configured Exe in all test projects (AutoMapper.UnitTests.csproj, AutoMapper.IntegrationTests.csproj, and AutoMapper.DI.Tests.csproj) per the xUnit v3 stand-alone executable model.
  • Update .NET Framework test target:
    • Raised .NET Framework target for AutoMapper.UnitTests from
      et471 to
      et472 (supported by xUnit v3); the core AutoMapper library continues targeting
      et471.
  • Clean up src/UnitTests/App.config:
    • Removed xunit.appDomain setting and obsolete
      unit.framework binding redirects.
  • Enable .NET Framework test execution in LicenseAccessorTests:
    • Removed #if !NETFRAMEWORK around InvalidSignature_LogsCopyPasteHint_WithoutExceptionDetails. Since xUnit v3 runs tests in the test project's own executable process, AutoMapper.UnitTests.exe.config and binding redirects apply cleanly on .NET Framework.
  • Fail CI when zero tests are discovered:
    • Added -- RunConfiguration.TreatNoTestsAsError=true to Build.ps1 so that any test run failing to discover tests will return a non-zero exit code and fail the build.

@CLAassistant

CLAassistant commented Nov 19, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

- Migrate test packages from xunit v2 to xunit.v3 and runner 4.0
- Set OutputType to Exe for all test projects per xUnit v3 stand-alone executable model
- Update .NET Framework test target from net471 to net472 in AutoMapper.UnitTests
- Clean up src/UnitTests/App.config by removing xunit.appDomain and stale nunit binding redirects
- Remove #if !NETFRAMEWORK from InvalidSignature_LogsCopyPasteHint_WithoutExceptionDetails in LicenseAccessorTests
- Add RunConfiguration.TreatNoTestsAsError=true to Build.ps1 test execution to fail if no tests are discovered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move test projects to xUnit v3

2 participants