FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve reporting the subject when chaining Throw and Which by dennisdoomen · Pull Request #3160 · fluentassertions/fluentassertions · GitHub

Improve reporting the subject when chaining Throw and Which - #3160

Merged
dennisdoomen merged 1 commit into
fluentassertions:mainfrom
dennisdoomen:fix/871-exception-chaining
Feb 21, 2026
Merged

Improve reporting the subject when chaining Throw and Which#3160
dennisdoomen merged 1 commit into
fluentassertions:mainfrom
dennisdoomen:fix/871-exception-chaining

Conversation

dennisdoomen commented Feb 21, 2026
edited
Loading

Copy link
Copy Markdown
Member

This commit improves caller/subject identification for chained assertions, especially in exception assertions, by allowing the chain to prepend a custom prefix to the generated caller identifier.

throwingAction.Should().Throw<SomeException>().Which.Property.Should().Be("Value");

will now report

Expected SomeException.Property to be a match with the expectation, but it differs at index 0:

Notice the name of the exception type.

Closes #871

dennisdoomen force-pushed the fix/871-exception-chaining branch from 0f6e84c to 63d0829 Compare February 21, 2026 21:16
dennisdoomen added this to the 8.9 milestone Feb 21, 2026
dennisdoomen merged commit 268fee5 into fluentassertions:main Feb 21, 2026
5 checks passed
dennisdoomen deleted the fix/871-exception-chaining branch February 21, 2026 21:17

github-actions Bot commented Feb 21, 2026
edited
Loading

Copy link
Copy Markdown

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

This was referenced Mar 16, 2026
This was referenced Aug 23, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error message generation does not work very well for throw cases

1 participant


Back | FazBrowse Home | New Git URL