KotlinTest Testing Framework

Overview

Qualified supports writing tests for Kotlin using KotlinTest.

Basic Example

Solution

fun add(a: Int, b: Int) = a + b

Tests

import io.kotlintest.matchers.shouldBe
import io.kotlintest.specs.StringSpec

class TestAdd : StringSpec() {
    init {
        "add(1, 1) should return 2" {
            add(1, 1) shouldBe 2
        }
    }
}

Assertion Libraries

Following assertion libraries can be used:

Learn More

You can learn more on the KotlinTest website.