fix: failure messages of EquivalencyComparer#751
Conversation
Also improve code coverage for Exceptions `HasParamName`
There was a problem hiding this comment.
Pull Request Overview
This PR fixes failure messages in the EquivalencyComparer by changing "equivalent to" to "equivalent for" in negated scenarios, and improves test coverage for the Exceptions HasParamName functionality.
Key Changes
- Fixed failure message wording in
EquivalencyComparerfor negated equivalency checks - Added comprehensive test coverage for negated
HasParamNamescenarios - Enhanced
HasParamNameimplementation to properly handle null expected values in different grammar contexts
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/aweXpect.Tests/ThatGeneric.DoesNotComplyWith.Tests.cs | Updated expected error messages to use "equivalent for" instead of "equivalent to" |
| Tests/aweXpect.Tests/Objects/ThatObject.IsNotOneOf.Tests.cs | Updated expected error messages to use "equivalent for" instead of "equivalent to" |
| Tests/aweXpect.Tests/Objects/ThatObject.IsNotEquivalentTo.Tests.cs | Updated expected error messages to use "equivalent for" instead of "equivalent to" |
| Tests/aweXpect.Tests/Objects/ThatObject.IsEquivalentTo.Tests.cs | Added new test cases for IEqualityComparer scenarios and negated equivalency tests |
| Tests/aweXpect.Tests/Exceptions/ThatException.HasParamName.Tests.cs | Added comprehensive test coverage for negated HasParamName scenarios |
| Tests/aweXpect.Internal.Tests/ThatTests/Exceptions/HasParamNameValueConstraintTests.cs | Added unit tests for HasParamName expectation message formatting |
| Source/aweXpect/That/Exceptions/ThatException.HasParamName.cs | Enhanced implementation to handle null expected values and different grammar contexts |
| Source/aweXpect/Equivalency/EquivalencyComparer.cs | Fixed failure message wording and improved formatting for IEqualityComparer scenarios |
| Source/aweXpect.Core/Core/Polyfills/ReferenceEqualityComparer.cs | Added ExcludeFromCodeCoverage attribute |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Test Results 14 files - 24 14 suites - 24 4m 17s ⏱️ +36s Results for commit 5797bd6. ± Comparison against base commit ec4efe1. This pull request removes 1557 and adds 1566 tests. Note that renamed tests count towards both. |
|
🚀 Benchmark ResultsDetails
|
👽 Mutation ResultsaweXpectDetails
The final mutation score is 93.94%Coverage Thresholds: high:80 low:60 break:0aweXpect.CoreDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0 |
…mparer` (#751) by Valentin Breuß
…mparer` (#751) by Valentin Breuß
|
This is addressed in release v2.23.0. |




This PR fixes failure messages in the
EquivalencyComparerby changing "equivalent to" to "equivalent for" in negated scenarios, and improves test coverage for the ExceptionsHasParamNamefunctionality.Key Changes
EquivalencyComparerfor negated equivalency checksHasParamNamescenariosHasParamNameimplementation to properly handle null expected values in different grammar contexts