Shouldly
Search…
SubsetOf
1
var lisa = new Person { Name = "Lisa" };
2
var bart = new Person { Name = "Bart" };
3
var maggie = new Person { Name = "Maggie" };
4
var homer = new Person { Name = "Homer" };
5
var marge = new Person { Name = "Marge" };
6
var ralph = new Person { Name = "Ralph" };
7
var simpsonsKids = new List<Person> { bart, lisa, maggie, ralph };
8
var simpsonsFamily = new List<Person> { lisa, bart, maggie, homer, marge };
9
simpsonsKids.ShouldBeSubsetOf(simpsonsFamily);
Copied!
Exception
1
simpsonsKids
2
should be subset of
3
[Lisa, Bart, Maggie, Homer, Marge]
4
but
5
[Ralph]
6
is outside subset
Copied!
Copy link