assertk.assertions / doesNotHaveClass

doesNotHaveClass

fun <T : Any> Assert<T>.doesNotHaveClass(kclass: KClass<out T>): Unit

Platform and version requirements: Common

Asserts the value does not have the expected kotlin class. This is an exact match, so assertThat("test").doesNotHaveClass(String::class) is fails but assertThat("test").doesNotHaveClass(Any::class) is successful.

See Also

hasClass

isNotInstanceOf

fun <T : Any> <ERROR CLASS><T>.doesNotHaveClass(jclass: Class<out T>): <ERROR CLASS>

Platform and version requirements: JVM

Asserts the value does not have the expected java class. This is an exact match, so assertThat("test").doesNotHaveClass(String::class.java) is fails but assertThat("test").doesNotHaveClass(Any::class.java) is successful.

See Also

hasClass

isNotInstanceOf