Skip to content

feat: compare a pair of types by a predicate in equivalency - #1851

Merged
vbreuss merged 2 commits into
mainfrom
feat/comparing-type-pairs
Oct 16, 2026
Merged

vbreuss merged 2 commits into
mainfrom
feat/comparing-type-pairs

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 16, 2026

Copy link
Copy Markdown
Member

Mapping tests compare DTOs with entities whose members don't correspond by name, so the comparison by members can't tell whether they match. Comparing<TActual, TExpected>(predicate) lets a predicate decide wherever an actual TActual meets an expected TExpected, at any depth, also with IgnoringCollectionOrder() and within For<T>. A pair that doesn't match is reported with its path and the predicate.

The method lives in aweXpect.Core with an overload for EquivalencyOptions and one for EquivalencyTypeOptions, so that it ships with a Core release alone and Comparing<Dto, Entity>(...) needs no type argument for the options.

Mapping tests compare DTOs with entities whose members don't correspond by name, so the comparison by members can't tell whether they match. `Comparing<TActual, TExpected>(predicate)` lets a predicate decide wherever an actual `TActual` meets an expected `TExpected`, at any depth, also with `IgnoringCollectionOrder()` and within `For<T>`. A pair that doesn't match is reported with its path and the predicate.

The method lives in aweXpect.Core with an overload for `EquivalencyOptions` and one for `EquivalencyTypeOptions`, so that it ships with a Core release alone and `Comparing<Dto, Entity>(...)` needs no type argument for the options.
@vbreuss vbreuss self-assigned this Oct 16, 2026
@vbreuss
vbreuss merged commit daa8ced into main Oct 16, 2026
12 checks passed
@vbreuss
vbreuss deleted the feat/comparing-type-pairs branch October 16, 2026 22:07
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
42.3% Coverage on New Code (required ≥ 50%)

See analysis details on SonarQube Cloud

@github-actions

Copy link
Copy Markdown
Contributor

This is addressed in release v3.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant