Infix approach to build DSL
suggest changeIf you have:
infix fun <T> T?.shouldBe(expected: T?) = assertEquals(expected, this)
you can write the following DSL-like code in your tests:
@Test
fun test() {
100.plusOne() shouldBe 101
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents