I'm trying to compare the precision of two numbers with some tolerance.
This is how it was being checked in nUnit:
Assert.That(turnOver, Is.EqualTo(turnoverExpected).Within(0.00001).Percent);
I'm trying to do the same in xUnit but this is all I've come up with:
double tolerance = 0.00001;
Assert.Equal(turnOver, turnoverExpected, tolerance);
This doesn't compile because Assert.Equal
doesn't take a 3rd argument of type double
.
Anyone got an idea of a nice way to do this in xUnit?