assertk.assertions / prop

prop

fun <T, P> Assert<T>.prop(name: String, extract: (T) -> P): Assert<P>

Platform and version requirements: Common

Returns an assert that asserts on the given property of the value.

Parameters

name - The name of the property to show in failure messages.

extract - The function to extract the property value out of the value of the current assert.

fun <T, P> <ERROR CLASS><T>.prop(callable: KCallable<P>): <ERROR CLASS>

Platform and version requirements: JVM

Returns an assert that asserts on the given property.

Parameters

callable - The function to get the property value out of the value of the current assert. The same of this callable will be shown in failure messages.