Cleaned up more tests

This commit is contained in:
Erik C. Thauvin 2022-10-04 12:51:25 -07:00
parent 656740b748
commit ee74cf0cc4
2 changed files with 6 additions and 3 deletions

View file

@ -37,6 +37,7 @@ import assertk.assertThat
import assertk.assertions.contains
import assertk.assertions.isEqualTo
import assertk.assertions.isGreaterThan
import assertk.assertions.isNotNull
import assertk.assertions.prop
import net.thauvin.erik.crypto.CryptoPrice.Companion.apiCall
import net.thauvin.erik.crypto.CryptoPrice.Companion.buyPrice
@ -142,8 +143,10 @@ class CryptoPriceTest {
try {
sellPrice("FOOBAR")
} catch (e: CryptoException) {
assertThat(e, "sellPrice(FOOBAR)").prop(CryptoException::statusCode).isEqualTo(404)
assertThat(e.message!!, "sellPrice(FOOBAR)").contains("invalid", true)
assertThat(e, "sellPrice(FOOBAR)").all {
prop(CryptoException::statusCode).isEqualTo(404)
prop(CryptoException::message).isNotNull().contains("invalid", true)
}
}
}