Quantcast
Channel: Fluent Assertions
Viewing all articles
Browse latest Browse all 1402

Edited Unassigned: Collection should contain other collection behaving unexpectedly [12495]

$
0
0
I want to assert that a collection of simple objects includes a smaller collection of the same object type. For some reason actualCollection.Should().Contain(expectedCollection) is failing with a message that shows all of the expected objects are in the actual collection but it's claiming that they aren't.

Here's the assertion failure output I'm getting:
```
Expected collection {
ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "custom"
percentage = 0.333333333333333
},

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "friends"
percentage = 0
},

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "friends of friends"
percentage = 0.333333333333333
},

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "only me"
percentage = 0
},

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "public"
percentage = 0.333333333333333
}} to contain {

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "custom"
percentage = 0.333333333333333
},

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "friends of friends"
percentage = 0.333333333333333
},

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "public"
percentage = 0.333333333333333
}}, but could not find {

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "custom"
percentage = 0.333333333333333
},

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "friends of friends"
percentage = 0.333333333333333
},

ActivityServiceTest.DataTypes.SocialItemSummary
{
category = "public"
percentage = 0.333333333333333
}}
```

Viewing all articles
Browse latest Browse all 1402

Trending Articles