🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

assertIsEqualTo

Asserts that this value is equal to the given expected value.

assertIsEqualTo

Source set: Common
public fun Dp.assertIsEqualTo(expected: Dp, subject: String, tolerance: Dp = Dp(.5f))

Asserts that this value is equal to the given expected value.

Performs the comparison with the given tolerance or the default one if none is provided. It is recommended to use tolerance when comparing positions and size coming from the framework as there can be rounding operation performed by individual layouts so the values can be slightly off from the expected ones.

Parameters

expected The expected value to which this one should be equal to.
subject Used in the error message to identify which item this assertion failed on.
tolerance The tolerance within which the values should be treated as equal.

Throws: AssertionError

if comparison fails.