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

messageContains

infix fun <T : Throwable> Assert<T>.messageContains(expected: Any): Unit
Deprecated: Switch from Assert to Expect; will be removed with 1.0.0 -- see https://github.com/robstoll/atrium/releases/tag/v0.12.0#migration for migration hints and scripts.

Creates the assertion that the Throwable's message is not null (see message) and contains the toString representation of the given expected using a non disjoint search.

It is a shortcut for message { this to contain atLeast 1 value expected }

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed (this function expects Any for your convenience.

Exceptions

AssertionError - Might throw an AssertionError in case message is null or does not contain the expected object.

Return
Notice, that this assertion function cannot provide a fluent API because it depends on whether the first assertion message is not null) holds or not.

infix fun <T : Throwable> Assert<T>.messageContains(values: Values<Any>): Unit
Deprecated: Switch from Assert to Expect; will be removed with 1.0.0 -- see https://github.com/robstoll/atrium/releases/tag/v0.12.0#migration for migration hints and scripts.

Creates the assertion that the Throwable's message is not null (see message) and contains the toString representation of the given values using a non disjoint search.

It is a shortcut for message { this to contain atLeast 1 the values }

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

Exceptions

AssertionError - Might throw an AssertionError in case message is null or does not contain all the values.

Return
Notice, that this assertion function cannot provide a fluent API because it depends on whether the first assertion message is not null) holds or not.