assertk / assertk.assertions / prop

prop

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

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.

(jvm) fun <T, P> Assert<T>.prop(callable: KCallable<P>): Assert<P>

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.