Skip to content

Migrate documentation samples to NUnit4 #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Romfos
Copy link
Contributor

@Romfos Romfos commented Jul 13, 2025

Changes:

  • Migrate documentation samples to NUnit4
  • Update readme
  • Update acknowledgements
  • Remove NUnit.Framework.Legacy from tests
  • Enable NRE for ProtectedExtensions.cs

@Romfos Romfos requested review from dtchepak and Copilot July 13, 2025 11:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Legacy imports and replaced ClassicAssert calls with Assert.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 actual and expected parameters are reversed. It should read Assert.That(value, Is.EqualTo("world!")); to follow the NUnit Assert.That(actual, constraint) pattern.
Assert.That("world!", Is.EqualTo(value));

@Romfos Romfos mentioned this pull request Jul 13, 2025
21 tasks
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.

1 participant