Henning B
08/10/2021, 10:07 AMlist.none { it is State.StateA } shouldBe true
Goal is, to check if the list does not contain an element which matches a given predicateraulraja
08/10/2021, 10:15 AM!in
val x: Boolean = listOf(1, 2, 3).none { it == 1 } //false
val y: Boolean = 1 !in listOf(1, 2, 3) //false
Tobi M.
08/10/2021, 10:41 AMlist shouldNot singleElement { it is State.StateA }
You could also extract this into another function like
infix fun <T> Collection<T>.shouldNotHaveSingleElement(t: T) = this shouldNot singleElement(t)
sam
08/10/2021, 12:47 PMHenning B
08/10/2021, 2:58 PMstates.forAll { state -> state.shouldNotBeTypeOf<State.StateA>() }
Emil Kantis
08/16/2021, 12:32 PM