If we apply custom comparer with Using to Is.Not.EqualTo then Not is ignored and it starts to work as Is.EqualTo with Using.
Test below fails but should pass:
[Test]
public void UsesProvidedIComparerWithNot()
{
var comparer = new ObjectComparer();
Assert.Multiple(() =>
{
Assert.That(2 + 3, Is.Not.EqualTo(4).Using(comparer));
Assert.That(comparer.WasCalled, "Comparer was not called");
});
}
It produces the followong error:
Assert.That(2 + 3, Is.Not.EqualTo(4).Using(comparer))
Expected: 4
But was: 5
If just remove .Using(comparer) it starts to work as expected.
Tested with latest NUnit 4.3.2 and .NET 8.
If we apply custom comparer with
UsingtoIs.Not.EqualTothenNotis ignored and it starts to work asIs.EqualTowithUsing.Test below fails but should pass:
It produces the followong error:
If just remove
.Using(comparer)it starts to work as expected.Tested with latest NUnit 4.3.2 and .NET 8.