jimbo R
jimbo R

Reputation: 253

How to assert a collection is a child of other collection using fluent-assertions?

I want to test a method returning collection using fluent-assertions to ensure that returned collection is a child of other collection, I tried fatherCollection.Should().Contain(childCollection); but not work. How to do that?

Upvotes: 0

Views: 371

Answers (1)

Dennis Doomen
Dennis Doomen

Reputation: 8889

You can use collection.Should().ContainEquivalentOf(item) on each of the items in the child collection.

Upvotes: 3

Related Questions