Files
openzeppelin-contracts/test/library/Math.test.js
Nicolás Venturo 67b67b791e Changed before for beforeAll, refactored Bouncer tests. (#1094)
* Changed before for beforeAll, refactored Bouncer tests.

* Fixed linter errors.

* fix: updates for SignatureBouncer tests and voucher construction
2018-07-20 12:25:40 -03:00

44 lines
951 B
JavaScript

var MathMock = artifacts.require('MathMock');
contract('Math', function (accounts) {
let math;
beforeEach(async function () {
math = await MathMock.new();
});
it('returns max64 correctly', async function () {
let a = 5678;
let b = 1234;
await math.max64(a, b);
let result = await math.result64();
assert.equal(result, a);
});
it('returns min64 correctly', async function () {
let a = 5678;
let b = 1234;
await math.min64(a, b);
let result = await math.result64();
assert.equal(result, b);
});
it('returns max256 correctly', async function () {
let a = 5678;
let b = 1234;
await math.max256(a, b);
let result = await math.result256();
assert.equal(result, a);
});
it('returns min256 correctly', async function () {
let a = 5678;
let b = 1234;
await math.min256(a, b);
let result = await math.result256();
assert.equal(result, b);
});
});