New issue
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
Inherited property cannot be excluded or included when comparing interface collections using runtime types #1363
Comments
Thank you for reporting this. I've managed to reproduce it. I'm afraid it's a bit of a compiler/language issue. Because your expectation is of type So it looks like your |
Looking at #956 at its fix, I think the member selection of FluentAssertions before the fix was too lax, so it picked up members not selected in the expression. But after the fix, the selection became too strict, and this issue surfaced. I think the problem is that |
Actually, it's used in the object initializer twice.
You might be on to something. |
I did some experimenting the last two days, but fixing this is going to be a lot harder than I thought. Just switching to the |
Fixed through #1631 |
Description
When a derive class implements an interface through an inherited property, the property cannot be excluded by
.Excluding()
or included by.Including()
when comparing collections of the interface using runtime types.Complete minimal example reproducing the issue
Expected behavior:
Both tests pass
Actual behavior:
Exclude
fails withInclude
fails withVersions
FluentAssertions 5.10.3 and 6.0.0-alpha.1
NUnit 3.12.0
.NET Core 3.1
The text was updated successfully, but these errors were encountered: