Add tests for money exchange

This commit is contained in:
Sambo Chea 2020-08-26 21:48:03 +07:00
parent b93c4ef5ac
commit 3f02799284

View File

@ -1,5 +1,6 @@
import com.cubetiqs.libra.moneyutils.Money import com.cubetiqs.libra.moneyutils.Money
import com.cubetiqs.libra.moneyutils.MoneyConfig import com.cubetiqs.libra.moneyutils.MoneyConfig
import com.cubetiqs.libra.moneyutils.MoneyExchangeUtils
import com.cubetiqs.libra.moneyutils.plus import com.cubetiqs.libra.moneyutils.plus
import com.cubetiqs.libra.moneyutils.times import com.cubetiqs.libra.moneyutils.times
import com.cubetiqs.libra.moneyutils.timesAssign import com.cubetiqs.libra.moneyutils.timesAssign
@ -27,5 +28,10 @@ class MoneyTests {
.parse("USD:1,KHR:4000") .parse("USD:1,KHR:4000")
println(MoneyConfig.getConfig()) println(MoneyConfig.getConfig())
val moneyUsd = Money(10.0)
val moneyKhr = MoneyExchangeUtils.exchange(moneyUsd, "KHR")
Assert.assertEquals(40000.0, moneyKhr.getMoneyValue(), 0.0)
} }
} }