kotest-assertions-core / io.kotest.matchers.collections / shouldNotBeOneOf

shouldNotBeOneOf

infix fun <T> T.shouldNotBeOneOf(collection: Collection<T>): Unit

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 Collection.shouldBeEmpty

See Also

shouldBeOneOf

beOneOf

fun <T> T.shouldNotBeOneOf(vararg any: T): Unit

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 Collection.shouldBeEmpty

See Also

shouldNotBeOneOf

beOneOf