Xuc Xiem
06/05/2020, 5:59 AMList<A>
& List<B>
and a function f: (A, B) -> Boolean
. I want to assert that for every element in listA
there's only one element in listB
so that f(a, b)
is true.
listA.forEach { a ->
listB
.filter { f(a, it) }
.shouldBeSingleton()
}
I want to print out the element a
that makes the assertion fail. How could I do that?sam
06/07/2020, 1:07 AMlistA.forEach { a ->
listB.forOne { b ->
f(a, b) shouldBe true
}
}