Skip to content

Conversation

@jnyrup
Copy link
Member

@jnyrup jnyrup commented Feb 21, 2021

In 69c5231 SelfReferenceEquivalencyAssertionOptions was split into a generic and non-generic part, where the non-generic is used for the defaults in AssertionOptions.

Excluding(Expression<Func<IMemberInfo, bool>> predicate) was kept in the shared base class, but Including(Expression<Func<IMemberInfo, bool>> predicate) was moved to the generic child class, even though it does not rely on the generics.

With the change in this PR one can now write a test like

AssertionOptions.AssertEquivalencyUsing(e => e.Excluding(_ => true).Including(e => e.Name == "IncludeMe"));

var subject = new { IncludeMe = "Foo", ExcludeMe = "Bar" };
var expected = new { IncludeMe = "Foo", ExcludeMe = "Baz" };

subject.Should().BeEquivalentTo(expected);

@jnyrup jnyrup requested a review from dennisdoomen February 25, 2021 18:47
@jnyrup jnyrup merged commit ee0aa43 into fluentassertions:develop Feb 25, 2021
@jnyrup jnyrup deleted the MoveIncluding branch February 25, 2021 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants