NUnit 5 summary pages and v5 documentation updates - #1244
Conversation
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>
There was a problem hiding this comment.
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
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.
|
Are these documentation changes good to go for you? |
|
@OsirisTerje I'd started reviewing earlier but had to stop. Looks good so far I'm hoping to complete my review later tonight |
stevenaw
left a comment
There was a problem hiding this comment.
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.
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>
|
I'll merge this now. |
NUnit 5 summary pages and v5 documentation updates 62f1e71

Fixes #1164
Important
This PR depends on #1243 (DependsOnTest / DependsOnFixture documentation). Please merge #1243 first. The
"NUnit 5 - New features" page links to
attribute-dependsontestandattribute-dependsonfixture, which areadded 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)
V5BreakingChanges.md): for each breaking change issue in the5.0 milestone, why it was needed, what changed, and what to do.
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".
Action/Func<T>instead ofTestDelegate/ActualValueDelegateFunc<TActual>overloads, and removal ofApplyTo(ref TActual)TAttribute : AttributeNUnit.FrameworknamespaceStopRunActionno longer supports forced stopsActiveTestsproperty (with snippet)TestCaseData.CreateandTestCaseDataWithReturn(with snippet)ParamNameproperty (with snippet)Checks
🤖 Generated with Claude Code