assertk.assertions / isInstanceOf

isInstanceOf

fun <T : Any, S : T> Assert<T>.isInstanceOf(kclass: KClass<S>, f: (Assert<S>) -> Unit): Unit
Deprecated: Use isInstanceOf(kclass) instead.

Platform and version requirements: Common


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

Platform and version requirements: Common

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

See Also

isNotInstanceOf

hasClass

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

Platform and version requirements: JVM


fun <T : Any, S : T> <ERROR CLASS><T>.isInstanceOf(jclass: Class<S>, f: (<ERROR CLASS><S>) -> Unit): Unit
Deprecated: Use isInstanceOf(jclass) instead.

Platform and version requirements: JVM

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

isNotInstanceOf

hasClass