Hi, kotest newbie here. Is there a matcher to assert if all elements in a collection equals to certain value?
JP
05/21/2020, 7:09 AM
I’m in general new to testing, and currently the setting for testing is using junit5 as test runner and using the assertions from kotest.
Copy code
// part of build.gradle.kts
testImplementation(kotlin("test-junit5"))
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.2")
// kotest testImplementation("io.kotest:kotest-assertions-core-jvm:4.1.0.291-SNAPSHOT")
JP
05/21/2020, 7:15 AM
For my use case, I have a function which would return the same value, say
0
for some invalid input, and when I test invalid inputs, I didn’t want to write multiple duplicate lines of
… shouldBe 0
. So I started to wonder if there is a better way.