kotest-assertions-core / io.kotest.matchers.collections / kotlin.collections.Collection

Extensions for kotlin.collections.Collection

shouldBeEmpty

fun <T> Collection<T>.shouldBeEmpty(): Unit

shouldBeLargerThan

infix fun <T, U> Collection<T>.shouldBeLargerThan(other: Collection<U>): Unit

shouldBeSameSizeAs

infix fun <T, U> Collection<T>.shouldBeSameSizeAs(other: Collection<U>): Unit

shouldBeSingleton

Verifies this collection contains only one element

fun <T> Collection<T>.shouldBeSingleton(): Unitfun <T> Collection<T>.shouldBeSingleton(fn: (T) -> Unit): Unit

shouldBeSmallerThan

infix fun <T, U> Collection<T>.shouldBeSmallerThan(other: Collection<U>): Unit

shouldBeUnique

fun <T> Collection<T>.shouldBeUnique(): Unit

shouldContainAll

fun <T> Collection<T>.shouldContainAll(vararg ts: T): Unit
infix fun <T> Collection<T>.shouldContainAll(ts: Collection<T>): Unit

shouldContainAnyOf

fun <T> Collection<T>.shouldContainAnyOf(vararg ts: T): Unit
infix fun <T> Collection<T>.shouldContainAnyOf(ts: Collection<T>): Unit

shouldContainDuplicates

fun <T> Collection<T>.shouldContainDuplicates(): Unit

shouldContainExactly

fun <T> Collection<T>?.shouldContainExactly(vararg expected: T): Unit

shouldContainNoNulls

fun <T> Collection<T>.shouldContainNoNulls(): Unit

shouldContainNull

fun <T> Collection<T>.shouldContainNull(): Unit

shouldContainOnlyNulls

fun <T> Collection<T>.shouldContainOnlyNulls(): Unit

shouldExist

infix fun <T> Collection<T>.shouldExist(p: (T) -> Boolean): Unit

shouldHaveAtLeastSize

infix fun <T> Collection<T>.shouldHaveAtLeastSize(n: Int): Unit

shouldHaveAtMostSize

infix fun <T> Collection<T>.shouldHaveAtMostSize(n: Int): Unit

shouldHaveSingleElement

infix fun <T> Collection<T>.shouldHaveSingleElement(t: T): Unit
infix fun <T> Collection<T>.shouldHaveSingleElement(p: (T) -> Boolean): Unit

shouldHaveSize

infix fun <T> Collection<T>.shouldHaveSize(size: Int): Unit

shouldNotBeEmpty

fun <T> Collection<T>.shouldNotBeEmpty(): Unit

shouldNotBeSingleton

Verifies this collection doesn't contain only one element

fun <T> Collection<T>.shouldNotBeSingleton(): Unit

shouldNotBeUnique

fun <T> Collection<T>.shouldNotBeUnique(): Unit

shouldNotContainAll

fun <T> Collection<T>.shouldNotContainAll(vararg ts: T): Unit
infix fun <T> Collection<T>.shouldNotContainAll(ts: Collection<T>): Unit

shouldNotContainAnyOf

fun <T> Collection<T>.shouldNotContainAnyOf(vararg ts: T): Unit
infix fun <T> Collection<T>.shouldNotContainAnyOf(ts: Collection<T>): Unit

shouldNotContainDuplicates

fun <T> Collection<T>.shouldNotContainDuplicates(): Unit

shouldNotContainExactly

fun <T> Collection<T>?.shouldNotContainExactly(vararg expected: T): Unit

shouldNotContainNoNulls

fun <T> Collection<T>.shouldNotContainNoNulls(): Unit

shouldNotContainNull

fun <T> Collection<T>.shouldNotContainNull(): Unit

shouldNotContainOnlyNulls

fun <T> Collection<T>.shouldNotContainOnlyNulls(): Unit

shouldNotHaveSingleElement

infix fun <T> Collection<T>.shouldNotHaveSingleElement(t: T): Unit

shouldNotHaveSize

infix fun <T> Collection<T>.shouldNotHaveSize(size: Int): Unit