---
# System prepended metadata

title: A fluent testing wrapper around AssertJ
tags: [Kotlin]

---

###### 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)
}
```