Math.test.js 559 B

12345678910111213141516171819202122232425
  1. var MathMock = artifacts.require('./mocks/MathMock.sol');
  2. contract('Math', function (accounts) {
  3. let math;
  4. before(async function () {
  5. math = await MathMock.new();
  6. });
  7. it('returns max correctly', async function () {
  8. let a = 5678;
  9. let b = 1234;
  10. await math.max64(a, b);
  11. let result = await math.result();
  12. assert.equal(result, a);
  13. });
  14. it('returns min correctly', async function () {
  15. let a = 5678;
  16. let b = 1234;
  17. await math.min64(a, b);
  18. let result = await math.result();
  19. assert.equal(result, b);
  20. });
  21. });