Bump NSubstitute to 6.0.0, fix nullable-API test breaks#292
Merged
Conversation
NSubstitute 6.0 enables nullable annotations on its public API, which breaks the `(T)x[0]` CallInfo indexer cast pattern used in three test files. Switched to the null-safe `x.ArgAt<T>(0)` extension. Refitter.MSBuild 2.1.0 was evaluated but reverted to 2.0.0: the release refactored the MSBuild task itself and throws `MissingMethodException: System.Text.ValueStringBuilder.AsSpan()` during code generation in this environment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Jul 17, 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
NSubstitute5.3.0→6.0.0(major). Fixes the(T)x[0]CallInfo indexer cast pattern in 3 test files that no longer compiles under 6.0's nullable-annotated public API, switching to the null-safex.ArgAt<T>(0)extension.Refitter.MSBuild2.0.0→2.1.0but reverted: 2.1.0 refactored the MSBuild task itself and throwsMissingMethodException: System.Text.ValueStringBuilder.AsSpan()during code generation. Left at 2.0.0 pending an upstream fix.Supersedes/consolidates:
main; NSubstitute part applied here)main; Refitter.MSBuild part evaluated and skipped, see above)Test plan
dotnet build AppDomain.slnx— succeedsdotnet test tests/AppDomain.Tests(unit, excl. Integration) — 160 passeddotnet test libs/Momentum/tests/Momentum.Extensions.Tests— 341 passed🤖 Generated with Claude Code