XUnit v3 upgrade + fixes#50
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the Atc.Test library by upgrading from xUnit v2 to xUnit v3 and introduces a major version bump to 2.0. The upgrade enhances data attribute capabilities with async extensibility, implements deterministic frozen value handling with exact-type promotion, and improves safety around specimen reuse.
Key Changes
- xUnit v3 Migration: Complete migration of data attributes to use async
ValueTask<IReadOnlyCollection<ITheoryDataRow>>extensibility model - Enhanced Frozen Logic: Introduced two-phase frozen handling with positional reuse and exact-type promotion for member data attributes
- Infrastructure Modernization: Updated CI pipelines to .NET 9, comprehensive README restructuring, and improved developer experience
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
version.json |
Major version bump from 1.1 to 2.0 reflecting breaking changes |
src/Atc.Test/Atc.Test.csproj |
Updated dependencies to xUnit v3 and added .NET 9 target framework |
src/Atc.Test/MemberAutoNSubstituteDataAttribute.cs |
Complete rewrite to support async data generation with exact-type promotion |
src/Atc.Test/ClassAutoNSubstituteDataAttribute.cs |
Migrated to async model with positional-only frozen injection |
src/Atc.Test/FrozenParameterInjector.cs |
New shared helper centralizing frozen injection logic |
test/Atc.Test.Tests/MemberAutoNSubstituteDataAttributeTests.cs |
Added comprehensive tests for frozen reuse scenarios |
README.md |
Complete restructure with value proposition, compatibility notes, and usage examples |
.github/workflows/ |
Updated CI workflows to use .NET 9 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
rickykaare
approved these changes
Sep 15, 2025
rickykaare
left a comment
Collaborator
There was a problem hiding this comment.
Looks good 😊 Great job!
lupusbytes
reviewed
Sep 15, 2025
…te pattern Use protected AutoDataAttribute(Func<IFixture>) constructor with lambda. Fully qualify FixtureFactory to avoid shadowing with base property. Ensures custom fixture customizations still applied post-migration.
…nc GetData Replace IEnumerable<object[]> GetData override with ValueTask<IReadOnlyCollection<ITheoryDataRow>>. Augment each row with frozen parameter injection + generated specimens. Preserve row metadata; guard against null traits. Align with v3 TheoryDataRow / ITheoryDataRow contract.
…ta pipeline Remove obsolete [DataDiscoverer] (reflection abstractions removed in xUnit v3). Replace deprecated ConvertDataItem override with async GetData(MethodInfo, DisposalTracker). Wrap base data rows into new TheoryDataRow instances and append AutoFixture-generated specimens for missing parameters. Preserve existing metadata (skip, explicit, traits, etc.).
… to satisfy CA1019
…, upgrade guidance)
2833db3 to
94fe8d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade and modernization of Atc.Test to xUnit v3 with improved data attribute capabilities, deterministic frozen value handling, stronger safety around specimen reuse, and CI pipeline upgrade to .NET 9.
Key Changes
Framework & Infrastructure
ValueTask<IReadOnlyCollection<ITheoryDataRow>>).xunit.v3.extensibility.core; consumers must add a directPackageReferencetoxunit.v3.Data Attribute Enhancements
MemberAutoNSubstituteDataAttribute
ClassAutoNSubstituteDataAttribute
FrozenParameterInjector(shared helper extracting and unifying frozen injection logic).Frozen Semantics Hardening
IsInstanceOfTypematching with exact declared type + earliest index rule.Documentation & Developer Experience
xunit.v3a transitive dependency.Tests
Refactoring & Cleanup
FrozenParameterInjector.CI / Pipeline Modernization
actions/setup-dotnet 9.0.x).Breaking Changes
PackageReference Include="xunit.v3"[Frozen]or supply explicit alternate instance if reuse undesiredxunit.v3not pulled in indirectlyRationale
FrozenParameterInjector) simplifies maintenance and future enhancement.Implementation Notes
[Frozen]parameter typeITheoryDataRowproperties copied (Label, Explicit, Timeout, Traits) for supported sourcesCloses #49