Migrate documentation samples to NUnit4#889
Merged
Romfos merged 6 commits intonsubstitute:mainfrom Jul 27, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates all documentation samples and tests to NUnit 4 syntax, removes legacy NUnit support, and updates related project and documentation files.
- Upgraded NUnit package to version 4
- Removed
NUnit.Framework.Legacyimports and replacedClassicAssertcalls withAssert.That - Updated documentation examples and readme/acknowledgements to reflect new syntax and tooling
Reviewed Changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/NSubstitute.Documentation.Tests/NSubstitute.Documentation.Tests.csproj | Updated NUnit package reference from 3.x to 4.x |
| tests/NSubstitute.Documentation.Tests.Generator/DocumentationTestsGenerator.cs | Removed obsolete NSubstitute.Compatibility import |
| src/NSubstitute/Extensions/ProtectedExtensions.cs | Enabled null-return (object?) and NRE for protected extensions |
| docs/index.md | Converted example Assert.AreEqual to Assert.That syntax |
| README.md | Streamlined build instructions with updated link |
| acknowledgements.md | Marked deprecated tools and updated usage notes |
Comments suppressed due to low confidence (2)
README.md:131
- [nitpick] This line has lost context and proper markdown formatting. Consider restoring build instructions and formatting the link as
[Release procedure](https://github.com/nsubstitute/NSubstitute/wiki/Release-procedure)for clarity.
Release-procedure https://github.com/nsubstitute/NSubstitute/wiki/Release-procedure
docs/help/setting-out-and-ref-arguments/index.md:30
- The
actualandexpectedparameters are reversed. It should readAssert.That(value, Is.EqualTo("world!"));to follow the NUnitAssert.That(actual, constraint)pattern.
Assert.That("world!", Is.EqualTo(value));
26 tasks
dtchepak
approved these changes
Jul 27, 2025
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.
Changes: