fix: Correctly handle Throws<T>().Which.Satisfies#714
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the handling of Throws<T>().Which.Satisfies assertions by correctly implementing the constraint chain for typed exception throwing expectations. The fix ensures that when an exception of the expected type is thrown, the .Which continuation properly provides access to the exception for further assertions.
Key Changes
- Replaced generic
DelegateIsNotNullWithinTimeoutConstraintwith specializedDelegateThrowsWithinTimeoutConstraint<TException>for typed exception handling - Added proper processing strategy handling in
WhichNodeto respect constraint chain decisions - Enabled previously skipped test to validate the fix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Source/aweXpect.Core/Delegates/ThatDelegate.Throws.cs |
Implemented DelegateThrowsWithinTimeoutConstraint<TException> and DoNothingConstraint<T> to properly handle typed exception throwing with constraint chaining |
Source/aweXpect.Core/Core/Nodes/WhichNode.cs |
Added check for FurtherProcessingStrategy.IgnoreCompletely to respect parent constraint decisions |
Tests/aweXpect.Tests/Delegates/ThatDelegate.Throws.WhichTests.cs |
Re-enabled test by removing skip attribute to validate the fix |
f7a90e7 to
7b7407a
Compare
🚀 Benchmark ResultsDetails
|
…h.Satisfies` (#714) by Valentin Breuß
…h.Satisfies` (#714) by Valentin Breuß
|
This is addressed in release v2.21.1. |
This PR fixes the handling of
Throws<T>().Which.Satisfiesassertions by correctly implementing the constraint chain for typed exception throwing expectations. The fix ensures that when an exception of the expected type is thrown, the.Whichcontinuation properly provides access to the exception for further assertions.InvalidOperationExceptionwhen verifying that an exception is thrown which satisfies a condition #710