diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 8dc4293..e310056 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,6 +1,11 @@ + + diff --git a/src/main/kotlin/net/thauvin/erik/crypto/CryptoPrice.kt b/src/main/kotlin/net/thauvin/erik/crypto/CryptoPrice.kt index 5f3b99c..14095b4 100644 --- a/src/main/kotlin/net/thauvin/erik/crypto/CryptoPrice.kt +++ b/src/main/kotlin/net/thauvin/erik/crypto/CryptoPrice.kt @@ -55,9 +55,7 @@ open class CryptoPrice(val base: String, val currency: String, val amount: Doubl val json = JSONObject(this) if (json.has("data")) { with(json.getJSONObject("data")) { - return CryptoPrice( - getString("base"), getString("currency"), getString("amount").toDouble() - ) + return CryptoPrice(getString("base"), getString("currency"), getString("amount").toDouble()) } } else { throw CryptoException(message = "Missing price data.") diff --git a/src/test/kotlin/net/thauvin/erik/crypto/CryptoPriceTest.kt b/src/test/kotlin/net/thauvin/erik/crypto/CryptoPriceTest.kt index 172d74b..cd5d7f7 100644 --- a/src/test/kotlin/net/thauvin/erik/crypto/CryptoPriceTest.kt +++ b/src/test/kotlin/net/thauvin/erik/crypto/CryptoPriceTest.kt @@ -57,7 +57,7 @@ class CryptoPriceTest { assertEquals(price.currency, "USD", "buy BTC is USD") assertTrue(price.amount > 0.00, "buy BTC > 0") } - + @Test @Throws(CryptoException::class) fun testMarketPriceExceptions() { @@ -91,7 +91,7 @@ class CryptoPriceTest { assertEquals(price.amount, d, "amount is 57515.69") assertFailsWith( - message = "double convertion did not fail", + message = "double conversion did not fail", exceptionClass = CryptoException::class, block = { json.replace("5", "a").toPrice() } ) @@ -105,7 +105,7 @@ class CryptoPriceTest { assertFailsWith( message = "no base did not fail", exceptionClass = CryptoException::class, - block = { json.replace("base","foo").toPrice() } + block = { json.replace("base", "foo").toPrice() } ) } }