Address.test.js 597 B

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