public class Assert<T>
An assertion. Holds an actual value to assertion on and an optional name.
Assert.assertThat| Modifier and Type | Method and Description |
|---|---|
<R> Assert<R> |
assert(R actual,
java.lang.String name)
Deprecated.
|
<R> Assert<R> |
assertThat(R actual,
java.lang.String name)
Asserts on the given value with an optional name.
|
T |
getActual()
Deprecated.
|
java.lang.String |
getName() |
void |
given(kotlin.jvm.functions.Function1<? super T,kotlin.Unit> assertion)
Allows checking the actual value of an assert. This can be used to build your own custom assertions.
|
<R> Assert<R> |
transform(java.lang.String name,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Transforms an assertion from one type to another. If the assertion is failing the resulting assertion will still
be failing, otherwise the mapping function is called. An optional name can be provided, otherwise this
assertion's name will be used.
|
public <R> Assert<R> transform(java.lang.String name, kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Transforms an assertion from one type to another. If the assertion is failing the resulting assertion will still be failing, otherwise the mapping function is called. An optional name can be provided, otherwise this assertion's name will be used.
public void given(kotlin.jvm.functions.Function1<? super T,kotlin.Unit> assertion)
Allows checking the actual value of an assert. This can be used to build your own custom assertions.
fun Assert
public <R> Assert<R> assert(R actual, java.lang.String name)
Asserts on the given value with an optional name.
assert(true, name = "true").isTrue()
public <R> Assert<R> assertThat(R actual, java.lang.String name)
Asserts on the given value with an optional name.
assertThat(true, name = "true").isTrue()
public T getActual()
public java.lang.String getName()