Skip to content

NUnit 5 summary pages and v5 documentation updates - #1244

Merged
OsirisTerje merged 2 commits into
masterfrom
v5
Sep 26, 2026
Merged

OsirisTerje merged 2 commits into
masterfrom
v5

Conversation

@OsirisTerje

@OsirisTerje OsirisTerje commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Fixes #1164

Important

This PR depends on #1243 (DependsOnTest / DependsOnFixture documentation). Please merge #1243 first. The
"NUnit 5 - New features" page links to attribute-dependsontest and attribute-dependsonfixture, which are
added by that PR.

Summary

Adds two new pages for NUnit 5 and updates the existing documentation for the v5 changes.

New pages (added to the TOC)

  • NUnit 5 - A summary of the breaking changes (V5BreakingChanges.md): for each breaking change issue in the
    5.0 milestone, why it was needed, what changed, and what to do.
  • NUnit 5 - New features (V5NewFeatures.md): the same for the enhancements in the 5.0 milestone.

Updated pages

The main text describes NUnit 5 without version markers. Removed or changed APIs are covered by a historical
note or an "NUnit 4 and earlier" section, and new features get an "added in NUnit 5.0" callout, as in
"This constraint was added in NUnit 4.2".

  • Assert.Throws / Catch / DoesNotThrow and the constraint model: Action / Func<T> instead of TestDelegate /
    ActualValueDelegate
  • Assert.ThrowsAsync / CatchAsync / DoesNotThrowAsync: must be awaited
  • Custom Constraints: Func<TActual> overloads, and removal of ApplyTo(ref TActual)
  • SameAs constraint: reference types only
  • Attribute and AttributeExists constraints: TAttribute : Attribute
  • StringAssert, CollectionAssert, FileAssert and DirectoryAssert: back in the NUnit.Framework namespace
  • Framework API: StopRunAction no longer supports forced stops
  • TestContext: new ActiveTests property (with snippet)
  • TestCaseData: typed expected results with TestCaseData.Create and TestCaseDataWithReturn (with snippet)
  • Throws constraint: new ParamName property (with snippet)
  • Packaging the Framework: removed the .NET 6.0 SDK from the prerequisites

Checks

  • The new snippets build and pass against NUnit 5.0.0-beta.1.53.
  • markdownlint reports no errors on the changed files, and cspell reports no issues.

🤖 Generated with Claude Code

Add "NUnit 5 - A summary of the breaking changes" and "NUnit 5 - New
features" pages, and add them to the table of contents.

Update the affected pages for NUnit 5. Removed APIs keep their
documentation, marked as valid for NUnit 4 and earlier, and new parts
are marked "From version 5":
- Assert.Throws/Catch/DoesNotThrow and Assert.That take Action/Func
  instead of TestDelegate/ActualValueDelegate
- Async exception assertions must be awaited
- Custom constraints use Func<TActual>
- Is.SameAs is limited to reference types
- Has.Attribute<T> requires an attribute type
- StringAssert, CollectionAssert, FileAssert and DirectoryAssert are
  back in the NUnit.Framework namespace
- StopRunAction no longer supports forced stops
- New: TestContext.ActiveTests, typed TestCaseData expected results,
  ParamName on argument exception constraints (with snippets)
- Remove the .NET 6.0 SDK from the build prerequisites

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 24, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Final review identified documentation inaccuracies and omissions requiring correction.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Updates NUnit documentation for NUnit 5 breaking changes, new features, APIs, migration guidance, and examples.

Changes:

  • Adds NUnit 5 summary pages and navigation entries.
  • Updates assertion, constraint, framework, and packaging documentation.
  • Adds examples for typed test data, active tests, and ParamName.
File Summary
docs/​snippets/​Snippets.NUnit/​TestCaseDataExample.cs Adds typed expected-result examples.
docs/​snippets/​Snippets.NUnit/​Constraints/​ComparisonConstraintSnippets.cs Adds ParamName examples.
docs/​snippets/​Snippets.NUnit/​ActiveTestsExample.cs Adds an ActiveTests example.
docs/​articles/​nunit/​writing-tests/​TestContext.md Documents ActiveTests.
docs/​articles/​nunit/​writing-tests/​TestCaseData.md Documents typed results.
docs/​articles/​nunit/​writing-tests/​constraints/​ThrowsConstraint.md Documents ParamName.
docs/​articles/​nunit/​writing-tests/​constraints/​SameAsConstraint.md Documents reference-type restrictions.
docs/​articles/​nunit/​writing-tests/​constraints/​AttributeExistsConstraint.md Documents attribute type constraints.
docs/​articles/​nunit/​writing-tests/​constraints/​AttributeConstraint.md Documents attribute type constraints.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​String-Assert.md Updates namespace guidance.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​File-Assert.md Updates namespace guidance.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​Directory-Assert.md Updates namespace guidance.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​Collection-Assert.md Updates namespace guidance.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​Assert.ThrowsAsync.md Documents awaitable behavior.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​Assert.Throws.md Updates delegate signatures.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​Assert.DoesNotThrowAsync.md Documents awaitable behavior.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​Assert.DoesNotThrow.md Updates delegate signatures.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​Assert.CatchAsync.md Documents awaitable behavior.
docs/​articles/​nunit/​writing-tests/​assertions/​classic-assertions/​Assert.Catch.md Updates delegate signatures.
docs/​articles/​nunit/​writing-tests/​assertions/​assertions.md Updates classic assertion namespace guidance.
docs/​articles/​nunit/​writing-tests/​assertions/​assertion-models/​constraint.md Updates constraint delegate signatures.
docs/​articles/​nunit/​writing-tests/​assertions/​assertion-models/​classic.md Updates assertion namespace guidance.
docs/​articles/​nunit/​V5NewFeatures.md Adds the NUnit 5 feature summary.
docs/​articles/​nunit/​V5BreakingChanges.md Adds NUnit 5 migration guidance.
docs/​articles/​nunit/​toc.yml Adds the new pages to navigation.
docs/​articles/​nunit/​technical-notes/​nunit-internals/​Framework-Api.md Documents stop behavior changes.
docs/​articles/​nunit/​extending-nunit/​Custom-Constraints.md Updates custom constraint APIs.
docs/​articles/​developer-info/​Packaging-the-Framework.md Removes the .NET 6 SDK prerequisite.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/articles/nunit/extending-nunit/Custom-Constraints.md
@OsirisTerje

Copy link
Copy Markdown
Member Author

@stevenaw @manfred-brands

Are these documentation changes good to go for you?

@stevenaw

Copy link
Copy Markdown
Member

@OsirisTerje I'd started reviewing earlier but had to stop. Looks good so far I'm hoping to complete my review later tonight

@stevenaw stevenaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @OsirisTerje Looks pretty good.

I think I see a few places in the throws and async assertion pages where I think we have two version-related call outs for the same set of changes which I left a question around.

Comment thread docs/articles/nunit/extending-nunit/Custom-Constraints.md Outdated
Comment thread docs/articles/nunit/writing-tests/assertions/classic-assertions/Assert.Catch.md Outdated
The main text describes the current version without a version marker.
Older behavior is covered by a historical note or the existing "NUnit 4
and earlier" section, and callouts for new features say which version
added them, as in "This constraint was added in NUnit 4.2".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OsirisTerje

Copy link
Copy Markdown
Member Author

I'll merge this now.

@OsirisTerje
OsirisTerje merged commit 62f1e71 into master Sep 26, 2026
7 checks passed
@OsirisTerje
OsirisTerje deleted the v5 branch September 26, 2026 18:45
github-actions Bot pushed a commit that referenced this pull request Sep 26, 2026
NUnit 5 summary pages and v5 documentation updates 62f1e71
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.

NUnit 5 | Document changes wrt to transfer to Action/Func

3 participants