Davio
10/21/2022, 6:44 AMParameterizedTest
with a CSVSource
? I have two rows each with 3 values, but with the parameterized test, I have type safety by way of the method signature, which is myTest(Int, Int, String), my workaround for this is currently:
checkAll(Exhaustive.of(Triple(1, 1, "A"), Triple(2, 3, "B")) { }
But this does not seem very elegant as I still have to bind the triple values to the named variables I wantEmil Kantis
10/21/2022, 6:50 AMdata class MyRowData(a: Int, b: Int, c: String) // Maybe there's a better name for this based on your domain
context("Checking triplets") {
withData(
MyRowData(1, 1, "A"),
MyRowData(2, 3, "B")
) { (a, b, c) ->
a + b shouldBe c
}
}
Something like this? Would need to add kotest-framework-datatest
dependency to use itDavio
10/21/2022, 6:58 AMDavio
10/21/2022, 7:00 AMDavio
10/21/2022, 7:24 AMwithData
extension function, I noticed the module is in a 'weird' format, since it has .knm files so maybe that has something to do with itDavio
10/21/2022, 7:24 AMDavio
10/21/2022, 7:26 AMkotest-framework-datatest-jvm