Kotools Assert

Maven Central
Kotlin

Kotools Assert is a lightweight assertions library for Kotlin.

1 assertEquals 1
1.assertEquals(1, "1 should equal 1")
1.assertEquals(1) { "$this should be equal to $it" }

2 assertNotEquals 0
2.assertNotEquals(0, "2 shouldn't be equal to 0")
2.assertNotEquals(0) { "$this shouldn't be equal to $it" }

assertNull { null }
assertNull("result should be null") { null }
null.assertNull()
null assertNull "result should be null"
null assertNull { "result should be null" }

assertNotNull { 3 }
assertNotNull("result shouldn't be null") { 3 }
3.assertNotNull()
3 assertNotNull "result shouldn't be null"
3 assertNotNull { "result shouldn't be null" }

Installation

Gradle

Kotlin DSL

testImplementation("io.github.kotools:assert:1.0.0")

Groovy DSL

testImplementation 'io.github.kotools:assert:1.0.0'

Maven

<dependency>
    <groupId>io.github.kotools</groupId>
    <artifactId>assert</artifactId>
    <version>1.0.0</version>
    <scope>test</scope>
</dependency>

Documentation

Latest documentation of Kotools Assert is
available here.

Contributing

Feel free to contribute to the project with
issues and
pull requests.

License

This project is licensed under the
MIT License.

GitHub

View Github