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
This is almost the same as your code. The only simplification is using Assert.Contains instead of Assert.True(expected.Contains(...)).
[Fact]
public void SomeTest()
{
// Do something in Arrange and Act phase to obtain a collection
List actual = ...
// Now the important stuff in the Assert phase
var expected = new List { 42, 87, 30 };
Assert.Equal(expected.Count, actual.Count);
foreach (var item in expected)
Assert.Contains(item, actual);
}