Another important aspect of testing is understanding test results.
To make understanding test results easier, we should choose the right assertion methods that will give us the most information about the failure. All of these assertions would work, but the first two provide much clearer information
Example 1
number.shouldBe(100.0)
expected:<100.0> but was:<99.0>
Expected :100.0
Actual :99.0
string.shouldBe("Hello, Kotlin!")
expected:<"Hello, Kotlin!"> but was:<"Hello, Kotest!">
Expected :"Hello, Kotlin!"
Actual :"Hello, Kotest!"
Example 2
(string == "Hello, Kotlin!").shouldBeTrue()
Expected :true
Actual :false