doc / ch.tutteli.atrium.api.infix.en_GB / messageContains

messageContains

infix fun <T : Throwable> Expect<T>.messageContains(expected: CharSequenceOrNumberOrChar): Expect<T>

Expects that the property Throwable.message of the subject of the assertion is not null and contains expected's toString representation using a non disjoint search.

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed. This function expects CharSequenceOrNumberOrChar (which is a typealias for Any) for your convenience, so that you can mix String and Int for instance.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
An Expect for the current subject of the assertion.

infix fun <T : Throwable> Expect<T>.messageContains(values: Values<Any>): Expect<T>

Expects that the property Throwable.message of the subject of the assertion is not null and contains values's toString representation using a non disjoint search.

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed (this function expects Any for your convenience, so that you can mix String and Int for instance).

Parameters

values - The values which are expected to be contained within Throwable.message -- use the function values(t, ...) to create a Values.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
An Expect for the current subject of the assertion.