commit bcc56867dbecb7f41d52e09753256e1c604b1a8f parent e9cc8a8e44b6ad1269a53056500b45d564dc091b Author: ms <ms@taler.net> Date: Wed, 4 May 2022 10:49:41 +0200 new file (test case) Diffstat:
| A | util/src/test/kotlin/AmountTest.kt | | | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/util/src/test/kotlin/AmountTest.kt b/util/src/test/kotlin/AmountTest.kt @@ -0,0 +1,15 @@ +import org.junit.Test +import tech.libeufin.util.parseAmountAsString +import kotlin.reflect.typeOf + +class AmountTest { + @Test + fun parse() { + val resWithCurrency = parseAmountAsString("CURRENCY:5.5") + assert(resWithCurrency.first == "5.5") + assert(resWithCurrency.second == "CURRENCY") + val resWithoutCurrency = parseAmountAsString("5.5") + assert(resWithoutCurrency.first == "5.5") + assert(resWithoutCurrency.second == null) + } +} +\ No newline at end of file