Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request adds support for It.Is<T>() patterns in equivalency assertions, allowing for more flexible property-based comparisons when checking object equivalence. The feature enables using constraint-based expectations on individual properties during equivalency checks.
Key Changes:
- Introduces the
It.Is<T>()API for property-level equivalency constraints - Adds support for evaluating these constraints within the equivalency comparison engine
- Updates the
ToString()behavior of expectation results to delegate to the underlying expectation builder
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
Source/aweXpect.Core/Equivalency/It.cs |
New static class providing the It.Is<T>() API for equivalency constraints |
Source/aweXpect.Core/Equivalency/EquivalencyExpectationBuilder.cs |
New expectation builder specifically for equivalency scenarios with custom constraint evaluation |
Source/aweXpect.Core/Equivalency/EquivalencyComparison.Compare.cs |
Updates comparison logic to handle It.Is<T>() expressions during equivalency checks |
Source/aweXpect.Core/Results/ExpectationResult.cs |
Implements IOptionsProvider<ExpectationBuilder> interface and updates ToString() behavior |
Tests/aweXpect.Tests/Objects/ThatObject.IsEquivalentTo.ItIs.Tests.cs |
Comprehensive test suite covering various It.Is<T>() scenarios including success/failure cases |
Tests/aweXpect.Core.Tests/Results/ExpectationTests.cs |
Updates test expectation to reflect new ToString() behavior |
9943df7 to
6875ed0
Compare
Test Results 4 files - 34 4 suites - 34 18s ⏱️ - 3m 11s Results for commit 0830745. ± Comparison against base commit 7f21274. This pull request removes 13523 and adds 55 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
🚀 Benchmark ResultsDetails
|
cf5a164 to
3f2c14b
Compare
…o topic/it-is-for-equivalency
|
|
|
This is addressed in release v2.22.0. |



This pull request adds support for
It.Is<T>()patterns in equivalency assertions, allowing for more flexible property-based comparisons when checking object equivalence. The feature enables using constraint-based expectations on individual properties during equivalency checks.Key Changes:
It.Is<T>()API for property-level equivalency constraintsToString()behavior of expectation results to delegate to the underlying expectation builder