We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExcludingMissingMembers
WithMapping
Calling ExcludingMissingMembers/ThrowingOnMissingMembers calls ClearMatchingRules() and potentially removes an instance of MappedMemberMatchingRule.
ThrowingOnMissingMembers
ClearMatchingRules()
MappedMemberMatchingRule
[Fact] public void Exclusion_of_missing_members_works_with_mapping() { // Arrange var subject = new { Property1 = 1 }; var expectation = new { Property2 = 2, Ignore = 3 }; // Act / Assert subject.Should() .NotBeEquivalentTo(expectation, opt => opt .WithMapping("Property2", "Property1") .ExcludingMissingMembers() ); } [Fact] public void Mapping_works_with_exclusion_of_missing_members() { // Arrange var subject = new { Property1 = 1 }; var expectation = new { Property2 = 2, Ignore = 3 }; // Act / Assert subject.Should() .NotBeEquivalentTo(expectation, opt => opt .ExcludingMissingMembers() .WithMapping("Property2", "Property1") ); }
Both should pass
Exclusion_of_missing_members_works_with_mapping fails with
Exclusion_of_missing_members_works_with_mapping
Expected subject not to be equivalent to { Property2 = 2, Ignore = 3 }, but they are.
develop
The text was updated successfully, but these errors were encountered:
dennisdoomen
Successfully merging a pull request may close this issue.
Description
Calling
ExcludingMissingMembers
/ThrowingOnMissingMembers
callsClearMatchingRules()
and potentially removes an instance ofMappedMemberMatchingRule
.Complete minimal example reproducing the issue
Expected behavior:
Both should pass
Actual behavior:
Exclusion_of_missing_members_works_with_mapping
fails withVersions
develop
/ 418a405The text was updated successfully, but these errors were encountered: