public void WithinTolerance_Default_Yes_Assert() { double value = 1D; double obj = value + (FloatToleranceExtension.DefaultTolerance / 2); bool result = FloatToleranceExtension.WithinTolerance(value, obj); Assert.IsTrue(result); }
public void WithinTolerance_Default_No_Assert() { double value = 1D; double obj = value + FloatToleranceExtension.DefaultTolerance; bool result = FloatToleranceExtension.WithinTolerance(value, obj); Assert.IsFalse(result); }
public void WithinTolerance_Yes_Assert() { double tolerance = 0.001; double value = 1D; double obj = value + (tolerance / 2); bool result = FloatToleranceExtension.WithinTolerance(value, obj, tolerance); Assert.IsTrue(result); }