doc / ch.tutteli.atrium.api.cc.en_UK / toBeWithErrorTolerance

toBeWithErrorTolerance

fun Assert<Float>.toBeWithErrorTolerance(expected: Float, tolerance: Float): AssertionPlant<Float>
Deprecated: Use pendant from package en_GB; will be removed with 1.0.0


fun Assert<Double>.toBeWithErrorTolerance(expected: Double, tolerance: Double): AssertionPlant<Double>
Deprecated: Use pendant from package en_GB; will be removed with 1.0.0


fun Assert<BigDecimal>.toBeWithErrorTolerance(expected: BigDecimal, tolerance: BigDecimal): AssertionPlant<BigDecimal>
Deprecated: Use pendant from package en_GB; will be removed with 1.0.0

Makes the assertion that the Assert.subject is equal to expected with an error tolerance (range including bounds).

It effectively compares the absolute difference between Assert.subject and expected and compares it with the tolerance. As long as it is less than or equal the tolerance the assertion holds; otherwise it fails. A more mathematical way of expressing the assertion is the following inequality:

| Assert.subject - expected | ≤ tolerance

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
This plant to support a fluent API.