0

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?

Community
  • 1
  • 1
paulroho
  • 1,234
  • 1
  • 11
  • 27

1 Answers1

0

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.

Dennis Doomen
  • 8,368
  • 1
  • 32
  • 44