BeEquivalentTo
For().Exclude()
does not work for complex type hierarchies
#1986
Labels
BeEquivalentTo
For().Exclude()
does not work for complex type hierarchies
#1986
Description
I have a case where a base class is generic and the generic argument should be the class deriving from it. I'm trying to compare an object graph and exclude one property from this type, from a collection, i.e.
ShouldBeEquvalentTo(..., o => o.For(a => a.BS).Exclude(b => b.X.Y)
X is my type and Y is a property I want to exclude.
Note that if I have just one object and not the collection, it works fine.
Complete minimal example reproducing the issue
Expected behavior:
The test passes, objects are equivalent except for
foo.Bars[0].Y.LastModified
.Actual behavior:
The test fails with the following error:
Versions
FluentAssertions: 6.7.0
.NET 6.0 (sdk: 6.0.400, runtime: 6.0.8)
The text was updated successfully, but these errors were encountered: