CollectionAssert.AreEquivalent
is implemented as:
Assert.That(actual, new CollectionEquivalentConstraint(expected), message, args);
You can write out your assert that way and supply a custom IEqualityComparer
with Using
:
Assert.That(actual,
new CollectionEquivalentConstraint(expected).Using(customComparer));
You can also shorten new CollectionEquivalentConstraint
to Is.EquivalentTo
:
Assert.That(actual, Is.EquivalentTo(expected).Using(customComparer));