MSTest: CollectionAssert.AreEquivalent failed. The expected collection contains 1 occurrence(s) of
问题 Question : Can anyone tell me why my unit test is failing with this error message? CollectionAssert.AreEquivalent failed. The expected collection contains 1 occurrence(s) of . The actual collection contains 0 occurrence(s). Goal : I'd like to check if two lists are identical. They are identical if both contain the same elements with the same property values. The order is irrelevant. Code example : This is the code which produces the error. list1 and list2 are identical, i.e. a copy-paste of