public class AnyJVMKt
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
doesNotHaveClass(Assert<? extends T> $receiver,
java.lang.Class<? extends T> jclass)
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. |
static <T> void |
hasClass(Assert<? extends T> $receiver,
java.lang.Class<? extends T> jclass)
Asserts the value has the expected java class. This is an exact match, so
assertThat("test").hasClass(String::class.java) is successful but assertThat("test").hasClass(Any::class.java) fails. |
static <T> void |
isDataClassEqualTo(Assert<? extends T> $receiver,
T expected)
Like
PrimativeArrayKt.isEqualTo but reports exactly which properties differ. Only supports data classes. Note: you should
not use this if your data class has a custom Any.equals since it can be misleading. |
static <T,S extends T> |
isInstanceOf(Assert<? extends T> $receiver,
java.lang.Class<S> jclass)
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. |
static <T,S extends T> |
isInstanceOf(Assert<? extends T> $receiver,
java.lang.Class<S> jclass,
kotlin.jvm.functions.Function1<? super assertk.Assert<? extends S>,kotlin.Unit> f)
Deprecated.
|
static <T> void |
isNotInstanceOf(Assert<? extends T> $receiver,
java.lang.Class<? extends T> jclass)
Asserts the value is not an instance of the expected java class. Both
assertThat("test").isNotInstanceOf(String::class)
and assertThat("test").isNotInstanceOf(Any::class) fails. |
static <T> Assert<java.lang.Class> |
jClass(Assert<? extends T> $receiver)
Returns an assert on the java class of the value.
|
static <T,P> Assert<P> |
prop(Assert<? extends T> $receiver,
kotlin.reflect.KCallable<? extends P> callable)
Returns an assert that asserts on the given property.
|
public static <T> Assert<java.lang.Class> jClass(Assert<? extends T> $receiver)
Returns an assert on the java class of the value.
public static <T> void hasClass(Assert<? extends T> $receiver, java.lang.Class<? extends T> jclass)
Asserts the value has the expected java class. This is an exact match, so
assertThat("test").hasClass(String::class.java) is successful but assertThat("test").hasClass(Any::class.java) fails.
AnyKt.doesNotHaveClass,
AnyKt.isInstanceOfpublic static <T> void doesNotHaveClass(Assert<? extends T> $receiver, java.lang.Class<? extends T> jclass)
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.
AnyKt.hasClass,
AnyKt.isNotInstanceOfpublic static <T,S extends T> Assert<S> isInstanceOf(Assert<? extends T> $receiver, java.lang.Class<S> jclass)
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.
AnyKt.isNotInstanceOf,
AnyKt.hasClasspublic static <T,S extends T> void isInstanceOf(Assert<? extends T> $receiver, java.lang.Class<S> jclass, kotlin.jvm.functions.Function1<? super assertk.Assert<? extends S>,kotlin.Unit> f)
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.
AnyKt.isNotInstanceOf,
AnyKt.hasClasspublic static <T> void isNotInstanceOf(Assert<? extends T> $receiver, java.lang.Class<? extends T> jclass)
Asserts the value is not an instance of the expected java class. Both assertThat("test").isNotInstanceOf(String::class)
and assertThat("test").isNotInstanceOf(Any::class) fails.
AnyKt.isInstanceOf,
AnyKt.doesNotHaveClasspublic static <T,P> Assert<P> prop(Assert<? extends T> $receiver, kotlin.reflect.KCallable<? extends P> callable)
Returns an assert that asserts on the given property.
callable - The function to get the property value out of the value of the current assert. The same of this
callable will be shown in failure messages.public static <T> void isDataClassEqualTo(Assert<? extends T> $receiver, T expected)
Like PrimativeArrayKt.isEqualTo but reports exactly which properties differ. Only supports data classes. Note: you should
not use this if your data class has a custom Any.equals since it can be misleading.
PrimativeArrayKt.isEqualTo,
Any.equals