|
Assert |
sealed class Assert<out T>
An assertion. Holds an actual value to assertion on and an optional name. |
|
AssertBlock |
sealed class AssertBlock<out T>
An assertion on a block of code. Can assert that it either throws and error or returns a value. |
|
FailingAssert |
class FailingAssert<out T> : Assert<T> |
|
Table |
sealed class Table
A table of rows to assert on. This makes it easy to run the same assertions are a number of inputs and outputs. |
|
Table1 |
class Table1<C1> : Table
A table with rows of 1 value. |
|
Table1Builder |
class Table1Builder : TableBuilder
Builds a table with the given rows. |
|
Table2 |
class Table2<C1, C2> : Table
A table with rows of 2 values. |
|
Table2Builder |
class Table2Builder : TableBuilder
Builds a table with the given rows. |
|
Table3 |
class Table3<C1, C2, C3> : Table
A table with rows of 3 values. |
|
Table3Builder |
class Table3Builder : TableBuilder
Builds a table with the given rows. |
|
Table4 |
class Table4<C1, C2, C3, C4> : Table
A table with rows of 4 values. |
|
Table4Builder |
class Table4Builder : TableBuilder
Builds a table with the given rows. |
|
TableBuilder |
sealed class TableBuilder
Builds a table with the given rows. |
|
ThreadLocalRef |
open expect class ThreadLocalRef<T> |
|
ValueAssert |
class ValueAssert<out T> : Assert<T> |
|
AssertkDsl |
annotation class AssertkDsl
Marks the assertion DSL. |
annotation expect class PlatformName
Allows to resolve name conflicts from common modules. |
|
ThreadLocalRef |
actual typealias ThreadLocalRef<T> = ThreadLocal<T> |
|
value |
var <T> ThreadLocalRef<T>.value: T? |
|
all |
fun <T> Assert<T>.all(message: String = SoftFailure.defaultMessage, body: Assert<T>.() -> Unit): Unit
All assertions in the given lambda are run. |
|
assert |
fun <T>
Asserts on the given value with an optional name. fun <T>
Asserts on the given block. You can test that it returns a value or throws an exception. |
|
assertAll |
fun assertAll(f: () -> Unit): Unit
Runs all assertions in the given lambda and reports any failures. |
|
assertThat |
fun <T> assertThat(actual: T, name: String? = null): Assert<T>
Asserts on the given value with an optional name. fun <T> assertThat(getter: KProperty0<T>, name: String? = null): Assert<T>
Asserts on the given property reference using its name, if no explicit name is specified. This method should be preferred in cases, where property references can be used, as it uses the property's name for the assertion automatically. The name may optionally be overridden, if needed. fun <T> assertThat(f: () -> T): AssertBlock<T>
Asserts on the given block. You can test that it returns a value or throws an exception. |
|
catch |
fun catch(f: () -> Unit): Throwable?
Catches any exceptions thrown in the given lambda and returns it. This is an easy way to assert on expected thrown exceptions. |
|
fail |
fun fail(error: AssertionError): Nothing
Fail the test with the given {@link AssertionError}. fun fail(message: String, expected: Any? = NONE, actual: Any? = NONE): Nothing
Fail the test with the given message. |
|
notifyFailure |
fun notifyFailure(e: Throwable): Unit |
|
tableOf |
fun tableOf(name1: String): Table1Builderfun tableOf(name1: String, name2: String): Table2Builderfun tableOf(name1: String, name2: String, name3: String): Table3Builderfun tableOf(name1: String, name2: String, name3: String, name4: String): Table4Builder
Builds a table with the given column names. |