I'm trying to use .BeSubsetOf()
from Fluent Assertions to ensure that one collection of objects is a subset of another, bigger collection of objects of the same type, but the assertion always fails.
Example code:
var expected = new[]
{
new Campus
{
Id = 1,
Name = "Campus 1"
},
new Campus
{
Id = 2,
Name = "Campus 2"
},
new Campus
{
Id = 3,
Name = "Campus 3"
}
};
var actual = new[]
{
new Campus
{
Id = 1,
Name = "Campus 1"
},
new Campus
{
Id = 2,
Name = "Campus 2"
}
};
actual.Should().BeSubsetOf(expected);
What's wrong here?