isInstanceOf

inline fun <T : Any> Assert<Any>.isInstanceOf(): Assert<T>

Asserts the value is an instance of the expected kotlin class. Both assertThat("test").isInstanceOf<String>() and assertThat("test").isInstanceOf<Any>() are successful.

See also


fun <T : Any> Assert<Any>.isInstanceOf(kclass: KClass<T>): Assert<T>

Asserts the value is an instance of the expected kotlin class. Both assertThat("test").isInstanceOf(String::class) and assertThat("test").isInstanceOf(Any::class) are successful.

See also

fun <T : Any, S : T> Assert<T>.isInstanceOf(jclass: Class<S>): Assert<S>

Asserts the value is an instance of the expected java class. Both assertThat("test").isInstanceOf(String::class.java) and assertThat("test").isInstanceOf(Any::class.java) is successful.

See also