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

messageContains

fun <T : Throwable> Expect<T>.messageContains(expected: Any, vararg otherExpected: Any): Expect<T> (source)

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

It is more or less a shortcut for message { contains.atLeast(1).values(expected, otherExpected) }, depending on the implementation though.

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).

Exceptions

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

Return
An Expect for the current subject of the assertion.