public class MatchersKt
| Modifier and Type | Method and Description |
|---|---|
static <T> Matcher<java.util.Collection> |
atLeastSize(int n) |
static <T> Matcher<java.util.Collection> |
atMostSize(int n) |
static <T,U> Matcher<java.util.Collection> |
beLargerThan(java.util.Collection<? extends U> other) |
static <T> Matcher<T> |
beOneOf(java.util.Collection<? extends T> collection)
Mather that verifies that this instance is in collection
|
static <T,U> Matcher<java.util.Collection> |
beSameSizeAs(java.util.Collection<? extends U> other) |
static <T,U> Matcher<java.util.Collection> |
beSmallerThan(java.util.Collection<? extends U> other) |
static <T> Matcher<java.util.List> |
beSortedWith(java.util.Comparator<? super T> comparator) |
static <T> Matcher<java.util.List> |
beSortedWith(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> cmp) |
static <T> Matcher<java.util.Collection> |
beUnique() |
static <T,C extends Collection<? extends T>> |
contain(T t) |
static <T> Matcher<java.util.Collection> |
containDuplicates() |
static <T> Matcher<java.util.Collection> |
containExactly(T expected) |
static <T,C extends Collection<? extends T>> |
containExactly(C expected)
Assert that a collection contains exactly the given values and nothing else, in order.
|
static <T> Matcher<java.util.Collection> |
containExactlyInAnyOrder(T expected) |
static <T,C extends Collection<? extends T>> |
containExactlyInAnyOrder(C expected)
Assert that a collection contains exactly the given values and nothing else, in any order.
|
static <T> Matcher<java.util.Collection> |
containNoNulls() |
static <T> Matcher<java.util.Collection> |
containNull() |
static <T> Matcher<java.util.Collection> |
containOnlyNulls() |
static <T> Matcher<java.util.List> |
endWith(java.util.Collection<? extends T> slice) |
static <T> Matcher<java.util.Collection> |
exist(kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> p) |
static <T,L extends List<? extends T>> |
haveElementAt(int index,
T element) |
static <T extends Comparable<? super T>,C extends Collection<? extends T>> |
haveLowerBound(T t) |
static <T extends Comparable<? super T>,C extends Collection<? extends T>> |
haveUpperBound(T t) |
static <T> void |
shouldBeEmpty(java.util.Collection<? extends T> $receiver) |
static <T,U> void |
shouldBeLargerThan(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends U> other) |
static <T> void |
shouldBeOneOf(T $receiver,
java.util.Collection<? extends T> collection)
Verifies that this instance is in collection
|
static <T> void |
shouldBeOneOf(T $receiver,
T any)
Verifies that this instance is any of any
|
static <T,U> void |
shouldBeSameSizeAs(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends U> other) |
static <T,U> void |
shouldBeSmallerThan(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends U> other) |
static <T extends Comparable<? super T>> |
shouldBeSorted(java.util.List<? extends T> $receiver) |
static <T> void |
shouldBeSortedWith(java.util.List<? extends T> $receiver,
java.util.Comparator<? super T> comparator) |
static <T> void |
shouldBeSortedWith(java.util.List<? extends T> $receiver,
kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> cmp) |
static <T> void |
shouldBeUnique(java.util.Collection<? extends T> $receiver) |
static <T,C extends Collection<? extends T>> |
shouldContain(C $receiver,
T t) |
static <T> void |
shouldContainAll(java.util.Collection<? extends T> $receiver,
T ts) |
static <T> void |
shouldContainAll(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends T> ts) |
static <T> void |
shouldContainDuplicates(java.util.Collection<? extends T> $receiver) |
static <T,C extends Collection<? extends T>> |
shouldContainExactly(C $receiver,
C expected) |
static <T,C extends Collection<? extends T>> |
shouldContainExactly(C $receiver,
T expected) |
static <T,C extends Collection<? extends T>> |
shouldContainExactlyInAnyOrder(C $receiver,
C expected) |
static <T,C extends Collection<? extends T>> |
shouldContainExactlyInAnyOrder(C $receiver,
T expected) |
static <T> void |
shouldContainInOrder(java.util.List<? extends T> $receiver,
T ts) |
static <T> void |
shouldContainInOrder(java.util.List<? extends T> $receiver,
java.util.List<? extends T> expected) |
static <T> void |
shouldContainNoNulls(java.util.Collection<? extends T> $receiver) |
static <T> void |
shouldContainNull(java.util.Collection<? extends T> $receiver) |
static <T> void |
shouldContainOnlyNulls(java.util.Collection<? extends T> $receiver) |
static <T> void |
shouldEndWith(java.util.List<? extends T> $receiver,
java.util.Collection<? extends T> slice) |
static <T> void |
shouldExist(java.util.Collection<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> p) |
static <T> void |
shouldHaveAtLeastSize(java.util.Collection<? extends T> $receiver,
int n) |
static <T> void |
shouldHaveAtMostSize(java.util.Collection<? extends T> $receiver,
int n) |
static <T> void |
shouldHaveElementAt(java.util.List<? extends T> $receiver,
int index,
T element) |
static <T extends Comparable<? super T>,C extends Collection<? extends T>> |
shouldHaveLowerBound(C $receiver,
T t) |
static <T> void |
shouldHaveSingleElement(java.util.Collection<? extends T> $receiver,
T t) |
static <T> void |
shouldHaveSize(java.util.Collection<? extends T> $receiver,
int size) |
static <T extends Comparable<? super T>,C extends Collection<? extends T>> |
shouldHaveUpperBound(C $receiver,
T t) |
static <T> void |
shouldNotBeEmpty(java.util.Collection<? extends T> $receiver) |
static <T> void |
shouldNotBeOneOf(T $receiver,
java.util.Collection<? extends T> collection)
Verifies that this instance is NOT in collection
|
static <T> void |
shouldNotBeOneOf(T $receiver,
T any)
Verifies that this instance is NOT any of any
|
static <T extends Comparable<? super T>> |
shouldNotBeSorted(java.util.List<? extends T> $receiver) |
static <T> void |
shouldNotBeSortedWith(java.util.List<? extends T> $receiver,
java.util.Comparator<? super T> comparator) |
static <T> void |
shouldNotBeSortedWith(java.util.List<? extends T> $receiver,
kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> cmp) |
static <T> void |
shouldNotBeUnique(java.util.Collection<? extends T> $receiver) |
static <T,C extends Collection<? extends T>> |
shouldNotContain(C $receiver,
T t) |
static <T> void |
shouldNotContainAll(java.util.Collection<? extends T> $receiver,
T ts) |
static <T> void |
shouldNotContainAll(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends T> ts) |
static <T> void |
shouldNotContainDuplicates(java.util.Collection<? extends T> $receiver) |
static <T,C extends Collection<? extends T>> |
shouldNotContainExactly(C $receiver,
C expected) |
static <T,C extends Collection<? extends T>> |
shouldNotContainExactly(C $receiver,
T expected) |
static <T,C extends Collection<? extends T>> |
shouldNotContainExactlyInAnyOrder(C $receiver,
C expected) |
static <T,C extends Collection<? extends T>> |
shouldNotContainExactlyInAnyOrder(C $receiver,
T expected) |
static <T> void |
shouldNotContainInOrder(java.util.List<? extends T> $receiver,
java.util.List<? extends T> expected) |
static <T> void |
shouldNotContainNoNulls(java.util.Collection<? extends T> $receiver) |
static <T> void |
shouldNotContainNull(java.util.Collection<? extends T> $receiver) |
static <T> void |
shouldNotContainOnlyNulls(java.util.Collection<? extends T> $receiver) |
static <T> void |
shouldNotEndWith(java.util.List<? extends T> $receiver,
java.util.Collection<? extends T> slice) |
static <T> void |
shouldNotHaveElementAt(java.util.List<? extends T> $receiver,
int index,
T element) |
static <T> void |
shouldNotHaveSingleElement(java.util.Collection<? extends T> $receiver,
T t) |
static <T> void |
shouldNotHaveSize(java.util.Collection<? extends T> $receiver,
int size) |
static <T> void |
shouldNotStartWith(java.util.List<? extends T> $receiver,
java.util.Collection<? extends T> slice) |
static <T> void |
shouldStartWith(java.util.List<? extends T> $receiver,
java.util.Collection<? extends T> slice) |
static <T> Matcher<java.util.List> |
sortedWith(java.util.Comparator<? super T> comparator) |
static <T> Matcher<java.util.List> |
sortedWith(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> cmp) |
static <T> Matcher<java.util.List> |
startWith(java.util.Collection<? extends T> slice) |
public static <T> void shouldContainOnlyNulls(java.util.Collection<? extends T> $receiver)
public static <T> void shouldNotContainOnlyNulls(java.util.Collection<? extends T> $receiver)
public static <T> Matcher<java.util.Collection> containOnlyNulls()
public static <T> void shouldContainNull(java.util.Collection<? extends T> $receiver)
public static <T> void shouldNotContainNull(java.util.Collection<? extends T> $receiver)
public static <T> Matcher<java.util.Collection> containNull()
public static <T> void shouldStartWith(java.util.List<? extends T> $receiver,
java.util.Collection<? extends T> slice)
public static <T> void shouldNotStartWith(java.util.List<? extends T> $receiver,
java.util.Collection<? extends T> slice)
public static <T> Matcher<java.util.List> startWith(java.util.Collection<? extends T> slice)
public static <T> void shouldEndWith(java.util.List<? extends T> $receiver,
java.util.Collection<? extends T> slice)
public static <T> void shouldNotEndWith(java.util.List<? extends T> $receiver,
java.util.Collection<? extends T> slice)
public static <T> Matcher<java.util.List> endWith(java.util.Collection<? extends T> slice)
public static <T> void shouldHaveElementAt(java.util.List<? extends T> $receiver,
int index,
T element)
public static <T> void shouldNotHaveElementAt(java.util.List<? extends T> $receiver,
int index,
T element)
public static <T,L extends List<? extends T>> Matcher<L> haveElementAt(int index, T element)
public static <T> void shouldContainNoNulls(java.util.Collection<? extends T> $receiver)
public static <T> void shouldNotContainNoNulls(java.util.Collection<? extends T> $receiver)
public static <T> Matcher<java.util.Collection> containNoNulls()
public static <T,C extends Collection<? extends T>> void shouldContain(C $receiver, T t)
public static <T,C extends Collection<? extends T>> void shouldNotContain(C $receiver, T t)
public static <T,C extends Collection<? extends T>> Matcher<C> contain(T t)
public static <T,C extends Collection<? extends T>> void shouldNotContainExactly(C $receiver, C expected)
public static <T,C extends Collection<? extends T>> void shouldNotContainExactly(C $receiver, T expected)
public static <T,C extends Collection<? extends T>> void shouldContainExactly(C $receiver, C expected)
public static <T,C extends Collection<? extends T>> void shouldContainExactly(C $receiver, T expected)
public static <T> Matcher<java.util.Collection> containExactly(T expected)
public static <T,C extends Collection<? extends T>> Matcher<C> containExactly(C expected)
Assert that a collection contains exactly the given values and nothing else, in order.
public static <T,C extends Collection<? extends T>> void shouldNotContainExactlyInAnyOrder(C $receiver, C expected)
public static <T,C extends Collection<? extends T>> void shouldNotContainExactlyInAnyOrder(C $receiver, T expected)
public static <T,C extends Collection<? extends T>> void shouldContainExactlyInAnyOrder(C $receiver, C expected)
public static <T,C extends Collection<? extends T>> void shouldContainExactlyInAnyOrder(C $receiver, T expected)
public static <T> Matcher<java.util.Collection> containExactlyInAnyOrder(T expected)
public static <T,C extends Collection<? extends T>> Matcher<C> containExactlyInAnyOrder(C expected)
Assert that a collection contains exactly the given values and nothing else, in any order.
public static <T extends Comparable<? super T>,C extends Collection<? extends T>> void shouldHaveUpperBound(C $receiver, T t)
public static <T extends Comparable<? super T>,C extends Collection<? extends T>> Matcher<C> haveUpperBound(T t)
public static <T extends Comparable<? super T>,C extends Collection<? extends T>> void shouldHaveLowerBound(C $receiver, T t)
public static <T extends Comparable<? super T>,C extends Collection<? extends T>> Matcher<C> haveLowerBound(T t)
public static <T> void shouldBeUnique(java.util.Collection<? extends T> $receiver)
public static <T> void shouldNotBeUnique(java.util.Collection<? extends T> $receiver)
public static <T> Matcher<java.util.Collection> beUnique()
public static <T> void shouldContainDuplicates(java.util.Collection<? extends T> $receiver)
public static <T> void shouldNotContainDuplicates(java.util.Collection<? extends T> $receiver)
public static <T> Matcher<java.util.Collection> containDuplicates()
public static <T> Matcher<java.util.List> beSortedWith(java.util.Comparator<? super T> comparator)
public static <T> Matcher<java.util.List> beSortedWith(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> cmp)
public static <T> Matcher<java.util.List> sortedWith(java.util.Comparator<? super T> comparator)
public static <T> Matcher<java.util.List> sortedWith(kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> cmp)
public static <T extends Comparable<? super T>> void shouldBeSorted(java.util.List<? extends T> $receiver)
public static <T extends Comparable<? super T>> void shouldNotBeSorted(java.util.List<? extends T> $receiver)
public static <T> void shouldBeSortedWith(java.util.List<? extends T> $receiver,
java.util.Comparator<? super T> comparator)
public static <T> void shouldNotBeSortedWith(java.util.List<? extends T> $receiver,
java.util.Comparator<? super T> comparator)
public static <T> void shouldBeSortedWith(java.util.List<? extends T> $receiver,
kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> cmp)
public static <T> void shouldNotBeSortedWith(java.util.List<? extends T> $receiver,
kotlin.jvm.functions.Function2<? super T,? super T,java.lang.Integer> cmp)
public static <T> void shouldHaveSingleElement(java.util.Collection<? extends T> $receiver,
T t)
public static <T> void shouldNotHaveSingleElement(java.util.Collection<? extends T> $receiver,
T t)
public static <T> void shouldHaveSize(java.util.Collection<? extends T> $receiver,
int size)
public static <T> void shouldNotHaveSize(java.util.Collection<? extends T> $receiver,
int size)
public static <T,U> void shouldBeLargerThan(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends U> other)
public static <T,U> Matcher<java.util.Collection> beLargerThan(java.util.Collection<? extends U> other)
public static <T,U> void shouldBeSmallerThan(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends U> other)
public static <T,U> Matcher<java.util.Collection> beSmallerThan(java.util.Collection<? extends U> other)
public static <T,U> void shouldBeSameSizeAs(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends U> other)
public static <T,U> Matcher<java.util.Collection> beSameSizeAs(java.util.Collection<? extends U> other)
public static <T> void shouldHaveAtLeastSize(java.util.Collection<? extends T> $receiver,
int n)
public static <T> Matcher<java.util.Collection> atLeastSize(int n)
public static <T> void shouldHaveAtMostSize(java.util.Collection<? extends T> $receiver,
int n)
public static <T> Matcher<java.util.Collection> atMostSize(int n)
public static <T> void shouldExist(java.util.Collection<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> p)
public static <T> Matcher<java.util.Collection> exist(kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> p)
public static <T> void shouldContainInOrder(java.util.List<? extends T> $receiver,
T ts)
public static <T> void shouldContainInOrder(java.util.List<? extends T> $receiver,
java.util.List<? extends T> expected)
public static <T> void shouldNotContainInOrder(java.util.List<? extends T> $receiver,
java.util.List<? extends T> expected)
public static <T> void shouldBeEmpty(java.util.Collection<? extends T> $receiver)
public static <T> void shouldNotBeEmpty(java.util.Collection<? extends T> $receiver)
public static <T> void shouldContainAll(java.util.Collection<? extends T> $receiver,
T ts)
public static <T> void shouldNotContainAll(java.util.Collection<? extends T> $receiver,
T ts)
public static <T> void shouldContainAll(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends T> ts)
public static <T> void shouldNotContainAll(java.util.Collection<? extends T> $receiver,
java.util.Collection<? extends T> ts)
public static <T> void shouldBeOneOf(T $receiver,
java.util.Collection<? extends T> collection)
Verifies that this instance is in collection
Assertion to check that this instance is in collection. This assertion checks by reference, and not by value, therefore the exact instance must be in collection, or this will fail.
An empty collection will always fail. If you need to check for empty collection, use MatchersKt.shouldBeEmpty
public static <T> void shouldNotBeOneOf(T $receiver,
java.util.Collection<? extends T> collection)
Verifies that this instance is NOT in collection
Assertion to check that this instance is not in collection. This assertion checks by reference, and not by value, therefore the exact instance must not be in collection, or this will fail.
An empty collection will always fail. If you need to check for empty collection, use MatchersKt.shouldBeEmpty
public static <T> void shouldBeOneOf(T $receiver,
T any)
Verifies that this instance is any of any
Assertion to check that this instance is any of any. This assertion checks by reference, and not by value, therefore the exact instance must be in any, or this will fail.
An empty collection will always fail. If you need to check for empty collection, use MatchersKt.shouldBeEmpty
public static <T> void shouldNotBeOneOf(T $receiver,
T any)
Verifies that this instance is NOT any of any
Assertion to check that this instance is not any of any. This assertion checks by reference, and not by value, therefore the exact instance must not be in any, or this will fail.
An empty collection will always fail. If you need to check for empty collection, use MatchersKt.shouldBeEmpty
public static <T> Matcher<T> beOneOf(java.util.Collection<? extends T> collection)
Mather that verifies that this instance is in collection
Assertion to check that this instance is in collection. This matcher checks by reference, and not by value, therefore the exact instance must be in collection, or this will fail.
An empty collection will always fail. If you need to check for empty collection, use MatchersKt.shouldBeEmpty