Skip to content

Document that Assert.That now evaluates Func<T> actual values in NUnit 5 - #1270

Merged
SeanKilleen merged 1 commit into
masterfrom
1262_func-evaluation-breaking-change
Oct 22, 2026
Merged

SeanKilleen merged 1 commit into
masterfrom
1262_func-evaluation-breaking-change

Conversation

@SeanKilleen

Copy link
Copy Markdown
Member

Adds a warning to the TestDelegate/ActualValueDelegate section of the NUnit 5 breaking changes page explaining that Assert.That now evaluates a Func<T> passed as the actual value, so Assert.That(func, Is.Not.Null) checks the delegate's result rather than the delegate itself. Shows how to assert on the delegate instead and points at the analyzer diagnostic that surfaces the change.

Fixes #1262

🤖 Generated with Claude Code

Adds a warning to the `TestDelegate`/`ActualValueDelegate` section of the NUnit 5 breaking changes page explaining that `Assert.That` now evaluates a `Func<T>` passed as the actual value, so `Assert.That(func, Is.Not.Null)` checks the delegate's result rather than the delegate itself. Shows how to assert on the delegate instead and points at the analyzer diagnostic that surfaces the change.

Fixes #1262

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

📖 Docs preview removed because this PR was closed.

@OsirisTerje OsirisTerje 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.

Good

@SeanKilleen
SeanKilleen merged commit d9df568 into master Oct 22, 2026
6 checks passed
@SeanKilleen
SeanKilleen deleted the 1262_func-evaluation-breaking-change branch October 22, 2026 13:26
github-actions Bot pushed a commit that referenced this pull request Oct 22, 2026
…t 5 (#1270)

Adds a warning to the `TestDelegate`/`ActualValueDelegate` section of the NUnit 5 breaking changes page explaining that `Assert.That` now evaluates a `Func<T>` passed as the actual value, so `Assert.That(func, Is.Not.Null)` checks the delegate's result rather than the delegate itself. Shows how to assert on the delegate instead and points at the analyzer diagnostic that surfaces the change.

Fixes #1262

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> d9df568
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.

Behaviour change when checking Func for null (4.5.1->5.0.0)

2 participants