Package-level declarations

Types

Link copied to clipboard
fun interface ArgMatcher<in T>

Checks if given argument satisfies provided conditions.

Link copied to clipboard

Scope for declaring argument matchers.

Link copied to clipboard

Scope for declaring argument matchers.

Functions

Link copied to clipboard

Matches any argument.

Link copied to clipboard
fun <T> MokkeryMatcherScope.eq(value: T): T

DEPRECATED: This API is considered obsolete. Simply omit this matcher.

Link copied to clipboard
fun <T> MokkeryMatcherScope.eqRef(value: T): T

DEPRECATED: Renamed to ref.

Link copied to clipboard
fun <T : Comparable<T>> MokkeryMatcherScope.gt(value: T): T

Matches argument that is greater than value.

Link copied to clipboard
fun <T : Comparable<T>> MokkeryMatcherScope.gte(value: T): T

Matches an argument that is greater than or equal to value.

Link copied to clipboard
fun <T : Comparable<T>> MokkeryMatcherScope.lt(value: T): T

Matches argument that is less than value.

Link copied to clipboard
fun <T : Comparable<T>> MokkeryMatcherScope.lte(value: T): T

Matches an argument that is less than or equal to value.

Link copied to clipboard

Matches argument that satisfies a matcher. Cannot be used with ArgMatcher.Composite. Use matchesComposite instead.

fun <T> MokkeryMatcherScope.matches(toString: () -> String, predicate: (T) -> Boolean): T

Matches an argument according to the predicate. Registered matcher Any.toString calls toString.

Link copied to clipboard
fun <T> MokkeryMatcherScope.matchesBy(function: (T) -> Boolean): T

Matches an argument by calling given function. Also, it returns function name on Any.toString.

Link copied to clipboard

Matches an argument that satisfies a matcher composed of matchers with builder.

Link copied to clipboard
fun <T> MokkeryMatcherScope.matching(predicate: (T) -> Boolean): T
fun <T> MokkeryMatcherScope.matching(toString: () -> String, predicate: (T) -> Boolean): T

DEPRECATED: This API is considered obsolete. Use matches instead.

Link copied to clipboard
fun <T> MokkeryMatcherScope.matchingBy(function: (T) -> Boolean): T

DEPRECATED: Renamed to matchesBy

Link copied to clipboard
fun <T> MokkeryMatcherScope.neq(value: T): T

Matches an argument that is not equal to value.

Link copied to clipboard
fun <T> MokkeryMatcherScope.neqRef(value: T): T

Matches an argument whose reference is not equal to value's reference.

Link copied to clipboard
inline fun <T> MokkeryMatcherScope.ofType(): T

Matches an argument that is an instance of type T.

Link copied to clipboard
fun <T> MokkeryMatcherScope.ref(value: T): T

Matches an argument whose reference is equal to value's reference.