###### tags: `Kotlin` # A fluent testing wrapper around AssertJ ```kotlin import org.assertj.core.api.Assertions.assertThat internal infix fun Any?.shouldBe(other: Any?) { assertThat(this).isEqualTo(other) } internal infix fun <T : Any> Any?.shouldHaveType(type: Class<T>) { assertThat(this).isInstanceOf(type) } internal infix fun String?.shouldContain(string: CharSequence) { assertThat(this).contains(string) } internal infix fun <T> List<T>.shouldContain(element: T) { assertThat(this).contains(element) } internal infix fun String.shouldMatch(regexp: CharSequence) { assertThat(this).matches(regexp) } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up