View on GitHub

Kluent

Fluent Assertion-Library for Kotlin

Basic assertions

This assertions are available for all objects:

Testing for equality

anObject shouldEqual anotherObject
anObject shouldNotEqual anotherObject

Testing for referential equality

anObject shouldBe anObject
anObject shouldNotBe anotherObject

Testing for subtypes

anObject shouldBeInstanceOf Any::class
anObject shouldNotBeInstanceOf Int::class

Test for nullability

anObject.shouldBeNull()
anObject.shouldNotBeNull()

Testing booleans

isMale.shouldBeTrue()
isMale.shouldBeFalse()
isMale.shouldNotBeTrue()
isMale.shouldNotBeFalse()