Is there an easy way in xunit.net to compare two collections without regarding the items' order?
问题 In one of my tests, I want to ensure that a collection has certain items. Therefore, I want to compare this collection with the items of an expected collection not regarding the order of the items . Currently, my test code looks somewhat like this: [Fact] public void SomeTest() { // Do something in Arrange and Act phase to obtain a collection List<int> actual = ... // Now the important stuff in the Assert phase var expected = new List<int> { 42, 87, 30 }; Assert.Equal(expected.Count, actual