EnumerableSet.test.js 927 B

1234567891011121314151617181920212223242526272829303132
  1. const { BN } = require('@openzeppelin/test-helpers');
  2. const EnumerableAddressSetMock = artifacts.require('EnumerableAddressSetMock');
  3. const EnumerableUintSetMock = artifacts.require('EnumerableUintSetMock');
  4. const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior');
  5. contract('EnumerableSet', function (accounts) {
  6. // AddressSet
  7. describe('EnumerableAddressSet', function () {
  8. const [ accountA, accountB, accountC ] = accounts;
  9. beforeEach(async function () {
  10. this.set = await EnumerableAddressSetMock.new();
  11. });
  12. shouldBehaveLikeSet(accountA, accountB, accountC);
  13. });
  14. // UintSet
  15. describe('EnumerableUintSet', function () {
  16. const uintA = new BN('1234');
  17. const uintB = new BN('5678');
  18. const uintC = new BN('9101112');
  19. beforeEach(async function () {
  20. this.set = await EnumerableUintSetMock.new();
  21. });
  22. shouldBehaveLikeSet(uintA, uintB, uintC);
  23. });
  24. });