public class AnyKt
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
doesNotHaveClass(Assert<? extends T> $receiver,
kotlin.reflect.KClass<? extends T> kclass)
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. |
static <T> void |
hasClass(Assert<? extends T> $receiver,
kotlin.reflect.KClass<? extends T> kclass)
Asserts the value has the expected kotlin class. This is an exact match, so
assertThat("test").hasClass(String::class)
is successful but assertThat("test").hasClass(Any::class) fails. |
static void |
hasHashCode(Assert<? extends java.lang.Object> $receiver,
int hashCode)
Asserts the value has the expected hash code from it's hashCode.
|
static <T> void |
hasToString(Assert<? extends T> $receiver,
java.lang.String string)
Asserts the value has the expected string from it's toString.
|
static <T> Assert<java.lang.Integer> |
hashCodeFun(Assert<? extends T> $receiver)
Returns an assert on the hasCode method of the value.
|
static <T> void |
isEqualTo(Assert<? extends T> $receiver,
java.lang.Object expected)
Asserts the value is equal to the expected one, using
==. |
static <T> void |
isEqualToWithGivenProperties(Assert<? extends T> $receiver,
T other,
kotlin.reflect.KProperty1 properties)
Returns an assert that compares only the given properties on the calling class
|
static <T> void |
isIn(Assert<? extends T> $receiver,
T values)
Asserts the value is in the expected values, using
in. |
static <T,S extends T> |
isInstanceOf(Assert<? extends T> $receiver,
kotlin.reflect.KClass<S> kclass,
kotlin.jvm.functions.Function1<? super assertk.Assert<? extends S>,kotlin.Unit> f)
Deprecated.
|
static <T,S extends T> |
isInstanceOf(Assert<? extends T> $receiver,
kotlin.reflect.KClass<S> kclass)
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. |
static <T> void |
isNotEqualTo(Assert<? extends T> $receiver,
java.lang.Object expected)
Asserts the value is not equal to the expected one, using
!=. |
static <T> void |
isNotIn(Assert<? extends T> $receiver,
T values)
Asserts the value is not in the expected values, using
!in. |
static <T> void |
isNotInstanceOf(Assert<? extends T> $receiver,
kotlin.reflect.KClass<? extends T> kclass)
Asserts the value is not an instance of the expected kotlin class. Both
assertThat("test").isNotInstanceOf(String::class) and assertThat("test").isNotInstanceOf(Any::class) fails. |
static <T> void |
isNotNull(Assert<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super assertk.Assert<? extends T>,kotlin.Unit> f)
Deprecated.
|
static <T> Assert<T> |
isNotNull(Assert<? extends T> $receiver)
Asserts the value is not null. You can pass in an optional lambda to run additional assertions on the non-null value.
|
static <T> void |
isNotSameAs(Assert<? extends T> $receiver,
java.lang.Object expected)
Asserts the value is not the same as the expected one, using
!==. |
static <T> void |
isNull(Assert<? extends T> $receiver)
Asserts the value is null.
|
static <T> void |
isSameAs(Assert<? extends T> $receiver,
T expected)
Asserts the value is the same as the expected one, using
===. |
static <T> Assert<kotlin.reflect.KClass> |
kClass(Assert<? extends T> $receiver)
Returns an assert on the kotlin class of the value.
|
static <T,P> Assert<P> |
prop(Assert<? extends T> $receiver,
java.lang.String name,
kotlin.jvm.functions.Function1<? super T,? extends P> extract)
Returns an assert that asserts on the given property of the value.
|
static <T> Assert<java.lang.String> |
toStringFun(Assert<? extends T> $receiver)
Returns an assert on the toString method of the value.
|
public static <T> Assert<kotlin.reflect.KClass> kClass(Assert<? extends T> $receiver)
Returns an assert on the kotlin class of the value.
public static <T> Assert<java.lang.String> toStringFun(Assert<? extends T> $receiver)
Returns an assert on the toString method of the value.
public static <T> Assert<java.lang.Integer> hashCodeFun(Assert<? extends T> $receiver)
Returns an assert on the hasCode method of the value.
public static <T> void isEqualTo(Assert<? extends T> $receiver, java.lang.Object expected)
Asserts the value is equal to the expected one, using ==.
PrimativeArrayKt.isNotEqualTo,
AnyKt.isSameAspublic static <T> void isNotEqualTo(Assert<? extends T> $receiver, java.lang.Object expected)
Asserts the value is not equal to the expected one, using !=.
PrimativeArrayKt.isEqualTo,
AnyKt.isNotSameAspublic static <T> void isSameAs(Assert<? extends T> $receiver, T expected)
Asserts the value is the same as the expected one, using ===.
AnyKt.isNotSameAs,
PrimativeArrayKt.isEqualTopublic static <T> void isNotSameAs(Assert<? extends T> $receiver, java.lang.Object expected)
Asserts the value is not the same as the expected one, using !==.
AnyKt.isSameAs,
PrimativeArrayKt.isNotEqualTopublic static <T> void isIn(Assert<? extends T> $receiver, T values)
Asserts the value is in the expected values, using in.
AnyKt.isNotInpublic static <T> void isNotIn(Assert<? extends T> $receiver, T values)
Asserts the value is not in the expected values, using !in.
AnyKt.isInpublic static <T> void hasToString(Assert<? extends T> $receiver, java.lang.String string)
Asserts the value has the expected string from it's toString.
public static void hasHashCode(Assert<? extends java.lang.Object> $receiver, int hashCode)
Asserts the value has the expected hash code from it's hashCode.
public static <T> void isNull(Assert<? extends T> $receiver)
Asserts the value is null.
public static <T> void isNotNull(Assert<? extends T> $receiver, kotlin.jvm.functions.Function1<? super assertk.Assert<? extends T>,kotlin.Unit> f)
Asserts the value is not null. You can pass in an optional lambda to run additional assertions on the non-null value.
val name: String? = ...
assertThat(name).isNotNull() {
it.hasLength(4)
}
public static <T> Assert<T> isNotNull(Assert<? extends T> $receiver)
Asserts the value is not null. You can pass in an optional lambda to run additional assertions on the non-null value.
val name: String? = ...
assertThat(name).isNotNull().hasLength(4)
public static <T,P> Assert<P> prop(Assert<? extends T> $receiver, java.lang.String name, kotlin.jvm.functions.Function1<? super T,? extends P> extract)
Returns an assert that asserts on the given property of the value.
name - The name of the property to show in failure messages.extract - The function to extract the property value out of the value of the current assert.public static <T> void hasClass(Assert<? extends T> $receiver, kotlin.reflect.KClass<? extends T> kclass)
Asserts the value has the expected kotlin class. This is an exact match, so assertThat("test").hasClass(String::class)
is successful but assertThat("test").hasClass(Any::class) fails.
AnyKt.doesNotHaveClass,
AnyKt.isInstanceOfpublic static <T> void doesNotHaveClass(Assert<? extends T> $receiver, kotlin.reflect.KClass<? extends T> kclass)
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.
AnyKt.hasClass,
AnyKt.isNotInstanceOfpublic static <T> void isNotInstanceOf(Assert<? extends T> $receiver, kotlin.reflect.KClass<? extends T> kclass)
Asserts the value is not an instance of the expected kotlin class. Both
assertThat("test").isNotInstanceOf(String::class) and assertThat("test").isNotInstanceOf(Any::class) fails.
AnyKt.isInstanceOf,
AnyKt.doesNotHaveClasspublic static <T,S extends T> void isInstanceOf(Assert<? extends T> $receiver, kotlin.reflect.KClass<S> kclass, kotlin.jvm.functions.Function1<? super assertk.Assert<? extends S>,kotlin.Unit> f)
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.
AnyKt.isNotInstanceOf,
AnyKt.hasClasspublic static <T,S extends T> Assert<S> isInstanceOf(Assert<? extends T> $receiver, kotlin.reflect.KClass<S> kclass)
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.
AnyKt.isNotInstanceOf,
AnyKt.hasClasspublic static <T> void isEqualToWithGivenProperties(Assert<? extends T> $receiver, T other, kotlin.reflect.KProperty1 properties)
Returns an assert that compares only the given properties on the calling class
other - Other value to compare toproperties - properties of the type with which to compare