From 8b6269872935c7353a397d45446a4d9ff1b540b6 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 9 Mar 2017 21:34:55 +0100 Subject: [PATCH] add test for amount arithmetic --- src/emscriptif-test.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/emscriptif-test.ts b/src/emscriptif-test.ts index c30a06664..3046a147e 100644 --- a/src/emscriptif-test.ts +++ b/src/emscriptif-test.ts @@ -77,4 +77,13 @@ test("withdraw-request", (t: TestLib) => { t.pass(); }); - +test("withdraw-request", (t: TestLib) => { + const a1 = new native.Amount({currency: "KUDOS", value: 1, fraction: 50000000}); + const a2 = new native.Amount({currency: "KUDOS", value: 1, fraction: 50000000}); + a1.add(a2); + let x = a1.toJson(); + t.assert(x.currency == "KUDOS"); + t.assert(x.fraction == 0); + t.assert(x.value == 3); + t.pass(); +});