feat: add WithoutMessage for delegate assertions#793
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds new WithoutMessage methods for delegate assertions, providing the ability to verify that thrown exceptions do not have specific messages or message content. The feature enhances the exception assertion API by providing negative assertions for message validation.
Key changes:
- Added
DoesNotHaveMessageandDoesNotHaveMessageContainingmethods for exception assertions - Added
WithoutMessageandWithoutMessageContainingmethods for delegate exception assertions - Updated error message formatting to be more consistent and include contextual information
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/aweXpect/That/Exceptions/ThatException.HasMessage.cs | Added DoesNotHaveMessage method and updated constraint implementation |
| Source/aweXpect/That/Exceptions/ThatException.HasMessageContaining.cs | Added DoesNotHaveMessageContaining method and updated constraint implementation |
| Source/aweXpect/That/Delegates/ThatDelegateThrows.WithMessage.cs | Added WithoutMessage method for delegate assertions |
| Source/aweXpect/That/Delegates/ThatDelegateThrows.WithMessageContaining.cs | Added WithoutMessageContaining method for delegate assertions |
| Tests/aweXpect.Tests/Exceptions/ThatException.DoesNotHaveMessage.Tests.cs | Comprehensive test coverage for new DoesNotHaveMessage functionality |
| Tests/aweXpect.Tests/Exceptions/ThatException.DoesNotHaveMessageContaining.Tests.cs | Comprehensive test coverage for new DoesNotHaveMessageContaining functionality |
| Tests/aweXpect.Tests/Delegates/ThatDelegate.ThrowsException.WithoutMessage.Tests.cs | Test coverage for delegate WithoutMessage method |
| Tests/aweXpect.Tests/Delegates/ThatDelegate.ThrowsException.WithoutMessageContaining.Tests.cs | Test coverage for delegate WithoutMessageContaining method |
| Docs/pages/docs/expectations/06-delegates.md | Updated documentation with examples of new methods |
| Multiple test files | Updated expected error messages to include additional context information |
🚀 Benchmark ResultsDetails
|
👽 Mutation ResultsaweXpectDetails
The final mutation score is 91.67%Coverage Thresholds: high:80 low:60 break:0aweXpect.CoreDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0 |
|
Test Results 14 files - 24 14 suites - 24 4m 23s ⏱️ -44s Results for commit 9d7a849. ± Comparison against base commit 935f53e. This pull request removes 1568 and adds 1587 tests. Note that renamed tests count towards both. |
… assertions (#793) by Valentin Breuß
… assertions (#793) by Valentin Breuß
|
This is addressed in release v2.25.0. |



This PR adds new
WithoutMessagemethods for delegate assertions, providing the ability to verify that thrown exceptions do not have specific messages or message content. The feature enhances the exception assertion API by providing negative assertions for message validation.Key changes:
DoesNotHaveMessageandDoesNotHaveMessageContainingmethods for exception assertionsWithoutMessageandWithoutMessageContainingmethods for delegate exception assertions