Package kotools.assert

Types

Nested
Link copied to clipboard
@SinceKotoolsAssert(version = "2.1")
typealias Nested = org.junit.jupiter.api.Nested
Test
Link copied to clipboard
@SinceKotoolsAssert(version = "2.1")
typealias Test = org.junit.jupiter.api.Test

Functions

assertEquals
Link copied to clipboard
common
@SinceKotoolsAssert(version = "2.1")
infix fun <T> T.assertEquals(other: T)

Asserts that this value equals the other value.

assertFails
Link copied to clipboard
common
@SinceKotoolsAssert(version = "2.1")
inline fun assertFails(block: () -> Unit): Throwable

Asserts that the block function throws an error and returns this error.

assertFailsWith
Link copied to clipboard
common
@SinceKotoolsAssert(version = "2.1")
inline fun <T : Throwable> assertFailsWith(block: () -> Unit): T

Asserts that the block function throws an error of type T, and returns this error.

assertFalse
Link copied to clipboard
common
@SinceKotoolsAssert(version = "2.1")
fun Boolean.assertFalse()

Asserts that this value is false.

@SinceKotoolsAssert(version = "2.1")
inline fun assertFalse(block: () -> Boolean)

Asserts that the result of calling the block function is false.

assertNotEquals
Link copied to clipboard
common
@SinceKotoolsAssert(version = "2.1")
infix fun <T> T.assertNotEquals(other: T)

Asserts that this value is not equal to the other value.

assertNotNull
Link copied to clipboard
common
@SinceKotoolsAssert(version = "2.1")
fun <T> T?.assertNotNull(): T

Asserts that this value is not null and returns it.

@SinceKotoolsAssert(version = "2.1")
inline fun <T> assertNotNull(block: () -> T?): T

Asserts that the result of calling the block function is not null and returns it.

assertNull
Link copied to clipboard
common
@SinceKotoolsAssert(version = "2.1")
fun <T> T?.assertNull()

Asserts that this value is null.

@SinceKotoolsAssert(version = "2.1")
inline fun <T> assertNull(block: () -> T?)

Asserts that the result of calling the block function is null.

assertPass
Link copied to clipboard
@SinceKotoolsAssert(version = "2.1")
fun <T> assertPass(block: () -> T): T

Asserts that the block function doesn't throw an error and returns its result.

assertTrue
Link copied to clipboard
common
@SinceKotoolsAssert(version = "2.1")
fun Boolean.assertTrue()

Asserts that this value is true.

@SinceKotoolsAssert(version = "2.1")
inline fun assertTrue(block: () -> Boolean)

Asserts that the result of calling the block function is true.