Infix approach to build DSL

suggest change

If 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
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents