From 3f02799284836db9a92df24890154fcfc531a1cc Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Wed, 26 Aug 2020 21:48:03 +0700 Subject: [PATCH] Add tests for money exchange --- src/test/kotlin/MoneyTests.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/kotlin/MoneyTests.kt b/src/test/kotlin/MoneyTests.kt index 7fef8b8..899c416 100644 --- a/src/test/kotlin/MoneyTests.kt +++ b/src/test/kotlin/MoneyTests.kt @@ -1,5 +1,6 @@ import com.cubetiqs.libra.moneyutils.Money import com.cubetiqs.libra.moneyutils.MoneyConfig +import com.cubetiqs.libra.moneyutils.MoneyExchangeUtils import com.cubetiqs.libra.moneyutils.plus import com.cubetiqs.libra.moneyutils.times import com.cubetiqs.libra.moneyutils.timesAssign @@ -27,5 +28,10 @@ class MoneyTests { .parse("USD:1,KHR:4000") println(MoneyConfig.getConfig()) + + val moneyUsd = Money(10.0) + val moneyKhr = MoneyExchangeUtils.exchange(moneyUsd, "KHR") + + Assert.assertEquals(40000.0, moneyKhr.getMoneyValue(), 0.0) } } \ No newline at end of file