Upgrade to xUnit v3 4.0.0, add core specimen generators, and overhaul documentation - #56
Merged
Conversation
davidkallesen
force-pushed
the
feature/nuget-update
branch
2 times, most recently
from
August 24, 2026 07:05
7b08640 to
938bc15
Compare
- Updated xunit.v3 from 3.2.2 to 4.0.0 in test project - Updated xunit.v3.extensibility.core from 3.2.2 to 4.0.0 in src project - Suppressed NU1608 warning for AutoFixture.AutoNSubstitute dependency constraint (AutoFixture.AutoNSubstitute 4.18.1 hasn't officially declared NSubstitute 6.x support but they are compatible in practice) - Updated README.md to reflect new xunit version in installation example - Applied editor config formatting updates
Extends the built-in specimen coverage of FixtureFactory with three generators following the existing [AutoRegister] + ISpecimenBuilder pattern, so they are discovered automatically with no user action. - TimeOnlyGenerator: mirrors DateOnlyGenerator via TimeOnly.FromDateTime, closing the gap where DateOnly was supported but its sibling was not - UriGenerator: produces readable absolute URIs on the reserved example.org domain instead of AutoFixture's noisy defaults, improving assertion failure messages - TimeProviderGenerator: returns a fixed provider reporting a stable fixture-generated UTC instant with LocalTimeZone set to UTC, making time-dependent code deterministic and enabling [Frozen] TimeProvider to share one instant between the SUT and the assertions No new package dependencies were taken; the fixed provider is internal rather than depending on Microsoft.Extensions.TimeProvider.Testing, to keep the core package dependency-light. Also fixes a copy-paste error in the DateOnlyGenerator XML summary, which incorrectly read "has not been canceled". Adds 5 tests to CustomizationsTests, including coverage of frozen TimeProvider reuse and Uri uniqueness.
Documents AutoRegisterAttribute (contract, discovery, example) and ImmutableObjectCustomization (rationale, supported types), and fixes a typo in StringExtensions. Narrows NU1608 from a solution-wide NoWarn to a scoped PackageReference on NSubstitute, with a documented removal trigger, so future constraint violations are not hidden.
Leads with a 30-second before/after example and demotes the rationale below the usage content, so a new user sees the payoff first. Adds a cheat sheet, common recipes, a built-in specimen support table, a troubleshooting/FAQ section and a version compatibility table, and rewrites the table of contents to match.
…behaviour Add docs/working-with.md, a long-form companion to the README covering the four data attributes, [Frozen] semantics (including exact-type promotion and the deliberate non-promotion across interfaces), [AutoRegister] discovery and its constraints, the FixtureFactory customization pipeline, and the helper extensions.
davidkallesen
force-pushed
the
feature/nuget-update
branch
from
August 24, 2026 07:17
938bc15 to
b02c617
Compare
perkops
approved these changes
Aug 24, 2026
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
Package upgrades
xunit.v3.extensibility.core3.2.2 → 4.0.0 (andxunit.v34.0.0 in the test project)NSubstitute5.3.0 → 6.2.0AwesomeAssertions9.4.0 → 9.6.0Microsoft.NET.Test.Sdk18.6.0 → 18.9.0Microsoft.SourceLink.GitHub10.0.300 → 10.0.400Meziantou.Analyzer3.0.104 → 3.0.177,SonarAnalyzer.CSharp10.27 → 10.32NU1608
AutoFixture.AutoNSubstitute4.18.1 declaresNSubstitute (>= 2.0.3 && < 6.0.0), soresolving NSubstitute 6.2.0 raises NU1608. The used API surface is compatible, so the
warning is suppressed — but scoped to the resolved
NSubstitutereference ratherthan suppressed globally, with an inline comment recording the condition for removal
(an AutoFixture release declaring NSubstitute 6 support). The build is warning-free.
New specimen generators
Three types that previously either failed to generate or produced unusable values:
TimeOnlyGenerator— derives from a generatedDateTimeUriGenerator— deterministic, readable absolute URIs with sanitised segmentsTimeProviderGenerator— a fixed provider with a stableGetUtcNow()and UTClocal zone, making
[Frozen] TimeProvidera practical way to pin the clockCovered by new tests in
CustomizationsTests.Documentation
leads, followed by a cheat sheet, common recipes, a built-in specimen support
table, and a troubleshooting FAQ. The rationale sections were demoted rather than
removed.
docs/working-with.md: long-form guide covering the four data attributes,[Frozen]semantics (including exact-type promotion and the deliberatenon-promotion across interfaces),
[AutoRegister], theFixtureFactorypipeline,and the helper extensions. Kept separate so the README stays onboarding-first.
AddTimeout's debugger bypass,AwaitTasks, andCompareDateTimeUsingCloseTo's1000 ms default and overload shapes.
AutoRegisterAttributeandImmutableObjectCustomization;fixed a typo in
StringExtensions.