Skip to content

Glossary: Kotlin Beyond the Basics

assertEquals

Also written: assertIs, assertTrue, assertNull, assertFailsWith, assertions

`kotlin.test` functions that check a result. `assertEquals(expected, actual)` passes if the two are equal (expected first), `assertIs<T>` checks the type and smart-casts, and `assertFailsWith<E> { }` passes only if the block throws an `E`.

Where the book teaches it

Related terms

unit testkotlin.test