android-components / mozilla.components.support.test

Package mozilla.components.support.test

Functions

any

fun <T> any(): T

Mockito matcher that matches anything, including nulls and varargs.

eq

fun <T> eq(value: T): T

Mockito matcher that matches if the argument is the same as the provided value.

expectException

fun <T : Throwable> expectException(clazz: KClass<T>, block: () -> Unit): Unit

Expect block to throw an exception. Otherwise fail the test (junit).

mock

fun <T : Any> mock(): T

Dynamically create a mock object. This method is helpful when creating mocks of classes using generics.