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 r
Not a Xunit, but a Linq answer :
bool areSame = !expected.Except(actual).Any() && expected.Count == actual.Count;
So in XUnit :
Assert.True(!expected.Except(actual).Any() && expected.Count == actual.Count));
As @robi-y said, in Microsoft.VisualStudio.QualityTools.UnitTestFramework there is CollectionAssert.AreEquivalent