Files
openzeppelin-contracts/test/utils/Address.test.js
2019-01-18 15:33:51 -03:00

20 lines
601 B
JavaScript

const AddressImpl = artifacts.require('AddressImpl');
const SimpleToken = artifacts.require('SimpleTokenMock');
require('../helpers/setup');
contract('Address', function ([_, anyone]) {
beforeEach(async function () {
this.mock = await AddressImpl.new();
});
it('should return false for account address', async function () {
(await this.mock.isContract(anyone)).should.equal(false);
});
it('should return true for contract address', async function () {
const contract = await SimpleToken.new();
(await this.mock.isContract(contract.address)).should.equal(true);
});
});