dave08
01/21/2019, 3:59 AMinfix fun <T : Any?> T.shouldNotBeNull(assertionBlock: (T.() -> Unit)? = null)
, which is consistent and explicit, also the tests would continue on the properties, not the object itself (at worst there's always this
)...
Also the shouldBeInstance<Foo> { }
could similarly cast a more general object to Foo for further assertions, but then would it be on Any?
too? So maybe there could be infix fun <T : Any?> T.shouldNotBeNullAnd(assertionBlock: ((T) -> Unit)? = null)
for assertions on the object itself, and then use smart casting and contracts when they're out inside the block... same question as before, but I think the name and style is more appropriate...