test: add tests for max64 and min64 from Math

This commit is contained in:
Leo Arias
2017-12-06 06:37:45 +00:00
parent 83b941c76c
commit f162638cde
2 changed files with 43 additions and 0 deletions

26
test/Math.test.js Normal file
View File

@ -0,0 +1,26 @@
var MathMock = artifacts.require('./mocks/MathMock.sol');
contract('Math', function (accounts) {
let math;
before(async function () {
math = await MathMock.new();
});
it('returns max correctly', async function () {
let a = 5678;
let b = 1234;
await math.max64(a, b);
let result = await math.result();
assert.equal(result, a);
});
it('returns min correctly', async function () {
let a = 5678;
let b = 1234;
await math.min64(a, b);
let result = await math.result();
assert.equal(result, b);
});
});