This commit is contained in:
Erik C. Thauvin 2021-05-09 16:15:22 -07:00
parent 3ad86b3354
commit 4209cb83c5
3 changed files with 10 additions and 7 deletions

View file

@ -53,7 +53,7 @@ open class CryptoPrice(val base: String, val currency: String, val amount: Doubl
if (json.has("data")) {
with(json.getJSONObject("data")) {
return CryptoPrice(
getString("base"), getString("currency"), getString("amount").toDouble()
getString("base"), getString("currency"), getString("amount").toDouble()
)
}
} else {

View file

@ -52,15 +52,15 @@ class CryptoPriceTest {
@Throws(CryptoException::class)
fun testMarketPriceExceptions() {
assertFailsWith(
message = "FOO did not fail",
exceptionClass = CryptoException::class,
block = { marketPrice("FOO") }
message = "FOO did not fail",
exceptionClass = CryptoException::class,
block = { marketPrice("FOO") }
)
assertFailsWith(
message = "BAR did not fail",
exceptionClass = CryptoException::class,
block = { marketPrice("BTC", "BAR") }
message = "BAR did not fail",
exceptionClass = CryptoException::class,
block = { marketPrice("BTC", "BAR") }
)
try {