add test for amount arithmetic

This commit is contained in:
Florian Dold 2017-03-09 21:34:55 +01:00
parent e6aed62973
commit 8b62698729
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -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();
});