Question

I have to compare two collections taking into account only the shared properties. If I understand Dennis' comment on How to combine collection and property assertions using fluent-assertions? this should work as of version 2.0.

I am using this API:

ActualOes.ShouldHave().SharedProperties().EqualTo(expectedOes);

ActualOes is of type IEnumerable<IOe> and expectedOes is IEnumerable<Object> where the elements are objects of an anonymous type sharing just a few properties with the actual IOe interface.

When I run this, FA complains about the missing properties.

Am I using the wrong API?

Was it helpful?

Solution

It should work like that, although since FA 2.0 that API is not the recommended way of doing this (although that old API is using the new API under the hood). I need to see if any of the unit tests is covering this particular scenario.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top