aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-03-09 21:34:55 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-03-09 21:34:55 +0100
commit8b6269872935c7353a397d45446a4d9ff1b540b6 (patch)
treef4261bced3a1045b61b8ce7c05a0c7e35fec74df
parente6aed62973e3fdf57d879e9c9b23d6ddecf3191f (diff)
add test for amount arithmetic
-rw-r--r--src/emscriptif-test.ts11
1 files changed, 10 insertions, 1 deletions
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();
+});