How should I assert that two collections contain the same elements id order does NOT matter?
This means that the number of each element in the two collections are the same. Here are some examples:
Equal:
1,2,3,4 == 1,2,3,4
1,2,3,4 == 4,2,3,1
2,1,2 == 2,2,1
1,2,2 == 2,2,1
Not Equal:
1 != 1,1
1,1,2 != 1,2,2
Is there some canned function that will do what I want? I assume this would be in Microsoft.VisualStudio.QualityTools.UnitTestFramework.Assert or in LINQ. Assert would be preferable, since it would presumably give more information about how they are different.
You can use CollectionAssert.AreEquivalent.