What method should I use to claim that two lists contain the same objects with MSpec?
You can use the extension method ShouldContainOnly(IEnumerable<T>).
ShouldContainOnly(IEnumerable<T>)
So, if you have 2 lists, listAand listBuse:
listA
listB
listA.ShouldContainOnly(listB)
If the order of the items in the list does not matter, you should use
listA.ShouldContainOnly(listB); // both lists must have exactly the same items listA.ShouldContain(listB); // listA must at least contain the items of listB
If the order of the items matters, you can use
listA.ShouldEqual(listB);