Olai Solheim
09/14/2022, 1:21 PMDavis Mohar
09/14/2022, 1:23 PMperson
.shouldNotBeNull()
.name.shouldBe("Donald Duck")
Olai Solheim
09/14/2022, 1:24 PMOlai Solheim
09/14/2022, 1:27 PMDavis Mohar
09/14/2022, 1:28 PMperson
.shouldNotBeNull()
.let{
it.name.shouldBe("Donald Duck")
it.someOtherField.shouldBe("foo")
}
sam
09/14/2022, 1:31 PMsam
09/14/2022, 1:31 PMOlai Solheim
09/14/2022, 1:32 PMLeoColman
09/14/2022, 5:50 PMLeoColman
09/14/2022, 5:50 PMphldavies
09/16/2022, 3:34 PMperson should {
it.shouldNotBeNull()
it.name shouldBe "Donald Duck"
it.someOtherField shouldBe "foo"
}
although I’ve always thought infix fun <T> T.should(matcher: (T) -> Unit) = matcher(this)
would be nicer as infix fun <T> T.should(matches: T.() -> Unit) = this.matches()