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
assert("test").doesNotHaveClass(String::class.java) is fails but assert("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
assert("test").hasClass(String::class.java) is successful but assert("test").hasClass(Any::class.java) fails. |
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)
Asserts the value is an instance of the expected java class. Both
assert("test").isInstanceOf(String::class.java)
and assert("test").isInstanceOf(Any::class.java) is successful. |
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
assert("test").isNotInstanceOf(String::class)
and assert("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
assert("test").hasClass(String::class.java) is successful but assert("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
assert("test").doesNotHaveClass(String::class.java) is fails but assert("test").doesNotHaveClass(Any::class.java)
is successful.
AnyKt.hasClass,
AnyKt.isNotInstanceOfpublic 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 assert("test").isInstanceOf(String::class.java)
and assert("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 assert("test").isNotInstanceOf(String::class)
and assert("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.