diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-03-09 21:34:55 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-03-09 21:34:55 +0100 |
commit | 8b6269872935c7353a397d45446a4d9ff1b540b6 (patch) | |
tree | f4261bced3a1045b61b8ce7c05a0c7e35fec74df /src | |
parent | e6aed62973e3fdf57d879e9c9b23d6ddecf3191f (diff) |
add test for amount arithmetic
Diffstat (limited to 'src')
-rw-r--r-- | src/emscriptif-test.ts | 11 |
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(); +}); |