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

toBeWithErrorTolerance

fun Assert<Float>.toBeWithErrorTolerance(expected: Float, tolerance: Float): AssertionPlant<Float>
Deprecated: Switch from Assert to Expect; will be removed with 1.0.0 -- see https://github.com/robstoll/atrium/releases/tag/v0.9.0#migration for migration hints and scripts.


fun Assert<Double>.toBeWithErrorTolerance(expected: Double, tolerance: Double): AssertionPlant<Double>
Deprecated: Switch from Assert to Expect; will be removed with 1.0.0 -- see https://github.com/robstoll/atrium/releases/tag/v0.9.0#migration for migration hints and scripts.


fun Assert<BigDecimal>.toBeWithErrorTolerance(expected: BigDecimal, tolerance: BigDecimal): AssertionPlant<BigDecimal>
Deprecated: Switch from Assert to Expect; will be removed with 1.0.0 -- see https://github.com/robstoll/atrium/releases/tag/v0.9.0#migration for migration hints and scripts.

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.