Asserter

interface Asserter (source)

Abstracts the logic for performing assertions. Specific implementations of Asserter can use JUnit or TestNG assertion facilities.

Functions

assertEquals

open fun assertEquals(
    message: String?,
    expected: Any?,
    actual: Any?
): Unit

Asserts that the specified values are equal.

assertNotEquals

open fun assertNotEquals(
    message: String?,
    illegal: Any?,
    actual: Any?
): Unit

Asserts that the specified values are not equal.

assertNotNull

open fun assertNotNull(message: String?, actual: Any?): Unit

Asserts that the specified value is not null.

assertNotSame

open fun assertNotSame(
    message: String?,
    illegal: Any?,
    actual: Any?
): Unit

Asserts that the specified values are not the same instance.

assertNull

open fun assertNull(message: String?, actual: Any?): Unit

Asserts that the specified value is null.

assertSame

open fun assertSame(
    message: String?,
    expected: Any?,
    actual: Any?
): Unit

Asserts that the specified values are the same instance.

assertTrue

open fun assertTrue(
    lazyMessage: () -> String?,
    actual: Boolean
): Unit
open fun assertTrue(message: String?, actual: Boolean): Unit

Asserts that the specified value is true.

fail

abstract fun fail(message: String?): Nothing

Fails the current test with the specified message.

Inheritors

DefaultAsserter

class DefaultAsserter : Asserter

Default Asserter implementation to avoid dependency on JUnit or TestNG.

JUnitAsserter

object JUnitAsserter : Asserter

Implements kotlin.test assertions by delegating them to org.junit.Assert class.

TestNGAsserter

object TestNGAsserter : Asserter

Implements kotlin.test assertions by delegating them to org.testng.Assert class.