Address.test.js 597 B

12345678910111213141516171819
  1. const AddressImpl = artifacts.require('AddressImpl');
  2. const SimpleToken = artifacts.require('SimpleToken');
  3. require('../helpers/setup');
  4. contract('Address', function ([_, anyone]) {
  5. beforeEach(async function () {
  6. this.mock = await AddressImpl.new();
  7. });
  8. it('should return false for account address', async function () {
  9. (await this.mock.isContract(anyone)).should.equal(false);
  10. });
  11. it('should return true for contract address', async function () {
  12. const contract = await SimpleToken.new();
  13. (await this.mock.isContract(contract.address)).should.equal(true);
  14. });
  15. });