|
atLeast |
fun <E, T : Iterable<E>> Assert<T>.atLeast(times: Int, f: (Assert<E>) -> Unit): Unit
Asserts on each item in the iterable, passing if at least |
|
atMost |
fun <E, T : Iterable<E>> Assert<T>.atMost(times: Int, f: (Assert<E>) -> Unit): Unit
Asserts on each item in the iterable, passing if at most |
|
bytes |
fun <ERROR CLASS><File>.bytes(): <ERROR CLASS>
Returns an assert on the file's contents as bytes. fun <ERROR CLASS><Path>.bytes(): <ERROR CLASS><ByteArray>
Assert on file bytes |
|
cause |
fun Assert<Throwable>.cause(): Assert<Throwable?>
Returns an assert on the throwable's cause. |
|
contains |
fun <T> Assert<Array<T>>.contains(element: Any?): Unit
Asserts the array contains the expected element, using fun Assert<Iterable<*>>.contains(element: Any?): Unit
Asserts the iterable contains the expected element, using fun <K, V> Assert<Map<K, V>>.contains(key: K, value: V): Unitfun <K, V> Assert<Map<K, V>>.contains(element: <ERROR CLASS><K, V>): Unit
Asserts the map contains the expected key-value pair. fun Assert<String>.contains(other: CharSequence, ignoreCase: Boolean = false): Unit
Asserts the string contains the expected string. |
|
containsAll |
fun <T> Assert<Array<T>>.containsAll(vararg elements: Any?): Unit
Asserts the array contains all the expected elements, in any order. The array may also contain additional elements. fun Assert<Collection<*>>.containsAll(vararg elements: Any?): Unit
Asserts the collection contains all the expected elements, in any order. The collection may also contain additional elements. fun <K, V> Assert<Map<K, V>>.containsAll(vararg elements: <ERROR CLASS><K, V>): Unit
Asserts the map contains all the expected elements. The map may also contain additional elements. |
|
containsExactly |
fun <T> Assert<Array<T>>.containsExactly(vararg elements: Any?): Unit
Asserts the array contains exactly the expected elements. They must be in the same order and there must not be any extra elements. fun Assert<List<*>>.containsExactly(vararg elements: Any?): Unit
Asserts the list contains exactly the expected elements. They must be in the same order and there must not be any extra elements. |
|
containsNone |
fun <T> Assert<Array<T>>.containsNone(vararg elements: Any?): Unitfun Assert<Collection<*>>.containsNone(vararg elements: Any?): Unit
Asserts the collection does not contain any of the expected elements. fun <K, V> Assert<Map<K, V>>.containsNone(vararg elements: <ERROR CLASS><K, V>): Unit
Asserts the map does not contain any of the expected elements. |
|
containsOnly |
fun Assert<Collection<*>>.containsOnly(vararg elements: Any?): Unit
Asserts the collection contains only the expected elements fun <K, V> Assert<Map<K, V>>.containsOnly(vararg elements: <ERROR CLASS><K, V>): Unit
Asserts the map contains only the expected elements. There must not be any extra elements. |
|
doesNotContain |
fun <T> Assert<Array<T>>.doesNotContain(element: Any?): Unit
Asserts the array does not contain the expected element, using fun Assert<Iterable<*>>.doesNotContain(element: Any?): Unit
Asserts the iterable does not contain the expected element, using fun <K, V> Assert<Map<K, V>>.doesNotContain(key: K, value: V): Unitfun <K, V> Assert<Map<K, V>>.doesNotContain(element: <ERROR CLASS><K, V>): Unit
Asserts the map does not contain the expected key-value pair. fun Assert<String>.doesNotContain(other: CharSequence, ignoreCase: Boolean = false): Unit
Asserts the string does not contain the specified string. |
fun <T : Any> Assert<T>.doesNotHaveClass(kclass: KClass<out T>): Unit
Asserts the value does not have the expected kotlin class. This is an exact match, so
fun <T : Any> <ERROR CLASS><T>.doesNotHaveClass(jclass: Class<out T>): <ERROR CLASS>
Asserts the value does not have the expected java class. This is an exact match, so
|
|
|
each |
fun <T> Assert<Array<T>>.each(f: (Assert<T>) -> Unit): Unit
Asserts on each item in the array. The given lambda will be run for each item. fun <E> Assert<Iterable<E>>.each(f: (Assert<E>) -> Unit): Unit
Asserts on each item in the iterable. The given lambda will be run for each item. |
|
endsWith |
fun Assert<String>.endsWith(other: String, ignoreCase: Boolean = false): Unit
Asserts the string ends with the expected string. |
|
exactly |
fun <E, T : Iterable<E>> Assert<T>.exactly(times: Int, f: (Assert<E>) -> Unit): Unit
Asserts on each item in the iterable, passing if exactly |
|
exists |
fun <ERROR CLASS><File>.exists(): <ERROR CLASS>
Asserts the file exists. |
|
extension |
fun <ERROR CLASS><File>.extension(): <ERROR CLASS>
Returns an assert on the file's extension. |
|
hasCause |
fun Assert<Throwable>.hasCause(cause: Throwable): Unit
Asserts the throwable is similar to the expected cause, checking the type and message. |
fun <T : Any> Assert<T>.hasClass(kclass: KClass<out T>): Unit
Asserts the value has the expected kotlin class. This is an exact match, so fun <T : Any> <ERROR CLASS><T>.hasClass(jclass: Class<out T>): <ERROR CLASS>
Asserts the value has the expected java class. This is an exact match, so
|
|
|
hasDirectChild |
fun <ERROR CLASS><File>.hasDirectChild(expected: File): <ERROR CLASS>
Asserts the file has the expected direct child. |
|
hasExtension |
fun <ERROR CLASS><File>.hasExtension(expected: String): Unit
Asserts the file has the expected extension. |
|
hasHashCode |
fun Assert<Any>.hasHashCode(hashCode: Int): Unit
Asserts the value has the expected hash code from it's hashCode. |
|
hasLength |
fun Assert<CharSequence>.hasLength(length: Int): Unit
Asserts the char sequence has the expected length. |
|
hasLineCount |
fun Assert<String>.hasLineCount(lineCount: Int): Unit
Asserts the string has the expected number of lines. |
|
hasMessage |
fun Assert<Throwable>.hasMessage(message: String?): Unit
Asserts the throwable has the expected message. |
|
hasName |
fun <ERROR CLASS><File>.hasName(expected: String): Unit
Asserts the file has the expected name. |
|
hasNoCause |
fun Assert<Throwable>.hasNoCause(): Unit
Asserts the throwable has no cause. |
|
hasNotSameContentAs |
fun <ERROR CLASS><InputStream>.hasNotSameContentAs(expected: InputStream): <ERROR CLASS>
Asserts that the actual stream has a different content as the expected stream. Both InputStreams will be closed by the assertion. |
|
hasParent |
fun <ERROR CLASS><File>.hasParent(expected: String): Unit
Asserts the file has the expected parent path. |
|
hasPath |
fun <ERROR CLASS><File>.hasPath(expected: String): Unit
Asserts the file has the expected path. |
|
hasRootCause |
fun Assert<Throwable>.hasRootCause(cause: Throwable): Unit
Asserts the throwable is similar to the expected root cause, checking the type and message. |
|
hasSameContentAs |
fun <ERROR CLASS><InputStream>.hasSameContentAs(expected: InputStream): <ERROR CLASS>
Asserts that the actual stream has the same content as the expected stream. Both InputStreams will be closed by the assertion. |
|
hasSameLengthAs |
fun Assert<CharSequence>.hasSameLengthAs(other: CharSequence): Unit
Asserts the char sequence has the same length as the expected one. |
|
hasSameSizeAs |
fun <T> Assert<Array<T>>.hasSameSizeAs(other: Array<*>): Unit
Asserts the array has the same size as the expected array. fun Assert<Collection<*>>.hasSameSizeAs(other: Collection<*>): Unit
Asserts the collection has the same size as the expected collection. fun Assert<Map<*, *>>.hasSameSizeAs(other: Map<*, *>): Unit
Asserts the map has the same size as the expected map. |
|
hasSize |
fun Assert<Array<*>>.hasSize(size: Int): Unit
Asserts the array has the expected size. fun Assert<Collection<*>>.hasSize(size: Int): Unitfun Assert<Map<*, *>>.hasSize(size: Int): Unit
Asserts the collection has the expected size. |
|
hasText |
fun <ERROR CLASS><File>.hasText(expected: String, charset: Charset = Charsets.UTF_8): Unit
Asserts the file contains exactly the expected text (and nothing else). |
|
hasToString |
fun <T> Assert<T>.hasToString(string: String): Unit
Asserts the value has the expected string from it's toString. |
|
hashCodeFun |
fun <T : Any> Assert<T>.hashCodeFun(): Assert<Int>
Returns an assert on the hasCode method of the value. |
|
index |
fun <T> Assert<Array<T>>.fun <T> Assert<Array<T>>.index(index: Int): Assert<T>
Returns an assert that assertion on the value at the given index in the array. fun <T> Assert<List<T>>.fun <T> Assert<List<T>>.index(index: Int): Assert<T>
Returns an assert that assertion on the value at the given index in the list. |
|
isBetween |
fun <A, B : Comparable<A>> Assert<B>.isBetween(start: A, end: A): Unit
Asserts the value is between the expected start and end values, inclusive. |
|
isCloseTo |
fun Assert<Float>.isCloseTo(value: Float, delta: Float): Unitfun Assert<Double>.isCloseTo(value: Double, delta: Double): Unit
Asserts the value if it is close to the expected value with given delta. |
|
isDataClassEqualTo |
fun <T : Any> <ERROR CLASS><T>.isDataClassEqualTo(expected: T): <ERROR CLASS>
Like 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. |
|
isDirectory |
fun <ERROR CLASS><File>.isDirectory(): <ERROR CLASS>
Asserts the file is a directory. fun <ERROR CLASS><Path>.isDirectory(vararg options: LinkOption): <ERROR CLASS>
Assert that the path is a directory. |
|
isEmpty |
fun Assert<Array<*>>.isEmpty(): Unit
Asserts the array is empty. fun Assert<CharSequence>.isEmpty(): Unit
Asserts the char sequence is empty. fun Assert<Collection<*>>.isEmpty(): Unitfun Assert<Map<*, *>>.isEmpty(): Unit
Asserts the collection is empty. fun Assert<Iterable<*>>.isEmpty(): Unit
Asserts the iterable is empty. |
|
isEqualTo |
fun <T> Assert<T>.isEqualTo(expected: Any?): Unit
Asserts the value is equal to the expected one, using fun <T> Assert<Array<T>>.isEqualTo(expected: Array<T>): Unit
Asserts the array contents are equal to the expected one, using contentDeepEquals. fun Assert<String?>.isEqualTo(other: String?, ignoreCase: Boolean = false): Unit
Asserts the string is equal to the expected string. |
fun <T : Any> <ERROR CLASS><T>.isEqualToIgnoringGivenProperties(other: T, vararg properties: KProperty1<T, Any>): Unit
Returns an assert that compares for all properties except the given properties on the calling class |
|
|
isEqualToWithGivenProperties |
fun <T> Assert<T>.isEqualToWithGivenProperties(other: T, vararg properties: KProperty1<T, Any>): Unit
Returns an assert that compares only the given properties on the calling class |
|
isExecutable |
fun <ERROR CLASS><Path>.isExecutable(): <ERROR CLASS>
Assert that the path is an executable. |
|
isFalse |
fun Assert<Boolean>.isFalse(): Unit
Asserts the boolean is false. |
|
isFile |
fun <ERROR CLASS><File>.isFile(): <ERROR CLASS>
Asserts the file is a simple file (not a directory). |
|
isGreaterThan |
fun <A, B : Comparable<A>> Assert<B>.isGreaterThan(other: A): Unit
Asserts the value is greater than the expected value, using |
|
isGreaterThanOrEqualTo |
fun <A, B : Comparable<A>> Assert<B>.isGreaterThanOrEqualTo(other: A): Unit
Asserts the value is greater or equal to the expected value, using |
|
isHidden |
fun <ERROR CLASS><File>.isHidden(): <ERROR CLASS>
Asserts the file is hidden. fun <ERROR CLASS><Path>.isHidden(): <ERROR CLASS>
Assert that the path is hidden. |
|
isIn |
fun <T> Assert<T>.isIn(vararg values: T): Unit
Asserts the value is in the expected values, using |
fun <T : Any, S : T> Assert<T>.fun <T : Any, S : T> Assert<T>.isInstanceOf(kclass: KClass<S>): Assert<S>
Asserts the value is an instance of the expected kotlin class. Both fun <T : Any, S : T> <ERROR CLASS><T>.isInstanceOf(jclass: Class<S>): <ERROR CLASS><S>fun <T : Any, S : T> <ERROR CLASS><T>.
Asserts the value is an instance of the expected java class. Both |
|
|
isLessThan |
fun <A, B : Comparable<A>> Assert<B>.isLessThan(other: A): Unit
Asserts the value is less than the expected value, using |
|
isLessThanOrEqualTo |
fun <A, B : Comparable<A>> Assert<B>.isLessThanOrEqualTo(other: A): Unit
Asserts the value is less than or equal to the expected value, using |
|
isNegative |
fun <T : Number> Assert<T>.isNegative(): Unit
Asserts the number is less than 0. |
|
isNotEmpty |
fun Assert<Array<*>>.isNotEmpty(): Unit
Asserts the array is not empty. fun Assert<CharSequence>.isNotEmpty(): Unit
Asserts the char sequence is not empty. fun Assert<Collection<*>>.isNotEmpty(): Unitfun Assert<Map<*, *>>.isNotEmpty(): Unit
Asserts the collection is not empty. fun Assert<Iterable<*>>.isNotEmpty(): Unit
Asserts the iterable is not empty. |
|
isNotEqualTo |
fun <T> Assert<T>.isNotEqualTo(expected: Any?): Unit
Asserts the value is not equal to the expected one, using fun <T> Assert<Array<T>>.isNotEqualTo(expected: Array<T>): Unit
Asserts the array contents are not equal to the expected one, using contentDeepEquals. fun Assert<String?>.isNotEqualTo(other: String?, ignoreCase: Boolean = false): Unit
Asserts the string is not equal to the expected string. |
|
isNotHidden |
fun <ERROR CLASS><File>.isNotHidden(): <ERROR CLASS>
Asserts the file is not hidden. |
|
isNotIn |
fun <T> Assert<T>.isNotIn(vararg values: T): Unit
Asserts the value is not in the expected values, using |
fun <T : Any> Assert<T>.isNotInstanceOf(kclass: KClass<out T>): Unit
Asserts the value is not an instance of the expected kotlin class. Both
fun <T : Any> <ERROR CLASS><T>.isNotInstanceOf(jclass: Class<out T>): <ERROR CLASS>
Asserts the value is not an instance of the expected java class. Both |
|
|
isNotNull |
fun <T : Any> Assert<T?>.fun <T : Any> Assert<T?>.isNotNull(): Assert<T>
Asserts the value is not null. You can pass in an optional lambda to run additional assertions on the non-null value. |
|
isNotSameAs |
fun <T> Assert<T>.isNotSameAs(expected: Any?): Unit
Asserts the value is not the same as the expected one, using |
|
isNotZero |
fun <T : Number> Assert<T>.isNotZero(): Unit
Asserts the number is not 0. |
|
isNull |
fun <T : Any> Assert<T?>.isNull(): Unit
Asserts the value is null. |
|
isNullOrEmpty |
fun Assert<Array<*>?>.isNullOrEmpty(): Unit
Asserts the array is null or empty. fun Assert<CharSequence?>.isNullOrEmpty(): Unit
Asserts the char sequence is null or empty. fun Assert<Collection<*>?>.isNullOrEmpty(): Unitfun Assert<Map<*, *>?>.isNullOrEmpty(): Unit
Asserts the collection is null or empty. |
|
isPositive |
fun <T : Number> Assert<T>.isPositive(): Unit
Asserts the number is greater than 0. |
|
isReadable |
fun <ERROR CLASS><Path>.isReadable(): <ERROR CLASS>
Assert that the path is readable. |
|
isRegularFile |
fun <ERROR CLASS><Path>.isRegularFile(vararg options: LinkOption): <ERROR CLASS>
Assert that the path is a regular file. |
|
isSameAs |
fun <T> Assert<T>.isSameAs(expected: T): Unit
Asserts the value is the same as the expected one, using |
|
isSameFileAs |
fun <ERROR CLASS><Path>.isSameFileAs(expected: Path): <ERROR CLASS>
Assert that the path points to the same object as the other path. |
|
isStrictlyBetween |
fun <A, B : Comparable<A>> Assert<B>.isStrictlyBetween(start: A, end: A): Unit
Asserts the value is between the expected start and end values, non-inclusive. |
|
isSymbolicLink |
fun <ERROR CLASS><Path>.isSymbolicLink(): <ERROR CLASS>
Assert that the path is a symbolic link. |
|
isTrue |
fun Assert<Boolean>.isTrue(): Unit
Asserts the boolean is true. |
|
isWritable |
fun <ERROR CLASS><Path>.isWritable(): <ERROR CLASS>
Assert that the path is writable link. |
|
isZero |
fun <T : Number> Assert<T>.isZero(): Unit
Asserts the number is 0. |
|
jClass |
fun <T : Any> <ERROR CLASS><T>.jClass(): <ERROR CLASS>
Returns an assert on the java class of the value. |
|
kClass |
fun <T : Any> Assert<T>.kClass(): Assert<KClass<out T>>
Returns an assert on the kotlin class of the value. |
|
key |
fun <K, V> Assert<Map<K, V>>.fun <K, V> Assert<Map<K, V>>.key(key: K): Assert<V>
Returns an assert that asserts on the value at the given key in the map. |
|
length |
fun Assert<CharSequence>.length(): Assert<Int>
Returns an assert on the CharSequence's length. |
|
lines |
fun <ERROR CLASS><Path>.lines(charset: Charset = Charsets.UTF_8): <ERROR CLASS><List<String>>
Assert on file lines |
|
matches |
fun Assert<String>.matches(regex: <ERROR CLASS>): Unit
Asserts the string matches the expected regular expression. |
|
matchesPredicate |
fun <T> Assert<T>.matchesPredicate(f: (T) -> Boolean): Unit
Asserts if the values satisfies the predicate provided. |
|
message |
fun Assert<Throwable>.message(): Assert<String?>
Returns an assert on the throwable's message. |
|
name |
fun <ERROR CLASS><File>.name(): <ERROR CLASS>
Returns an assert on the file's name. |
|
none |
fun <E> Assert<Iterable<E>>.none(f: (Assert<E>) -> Unit): Unit
Asserts on each item in the iterable, passing if none of the items pass. The given lambda will be run for each item. |
|
parent |
fun <ERROR CLASS><File>.parent(): <ERROR CLASS>
Returns an assert on the file's parent. |
|
path |
fun <ERROR CLASS><File>.path(): <ERROR CLASS>
Returns an assert on the file's path. |
fun <T, P> Assert<T>.prop(name: String, extract: (T) -> P): Assert<P>
Returns an assert that asserts on the given property of the value. fun <T, P> <ERROR CLASS><T>.prop(callable: KCallable<P>): <ERROR CLASS>
Returns an assert that asserts on the given property. |
|
|
rootCause |
fun Assert<Throwable>.rootCause(): Assert<Throwable>
Returns an assert on the throwable's root cause. |
|
size |
fun Assert<Array<*>>.size(): Assert<Int>
Returns an assert on the Arrays's size. fun Assert<Collection<*>>.size(): Assert<Int>
Returns an assert on the Collection's size. fun Assert<Map<*, *>>.size(): Assert<Int>
Returns an assert on the Maps's size. |
|
stackTrace |
fun <ERROR CLASS><Throwable>.stackTrace(): <ERROR CLASS>
Returns an assert on the throwable's stack trace. |
|
startsWith |
fun Assert<String>.startsWith(other: String, ignoreCase: Boolean = false): Unit
Asserts the string starts with the expected string. |
|
text |
fun <ERROR CLASS><File>.text(charset: Charset = Charsets.UTF_8): <ERROR CLASS>
Returns an assert on the file's contents as text. |
|
toStringFun |
fun <T> Assert<T>.toStringFun(): Assert<String>
Returns an assert on the toString method of the value. |