DetailedERC20.test.js 921 B

1234567891011121314151617181920212223242526272829303132333435
  1. const BigNumber = web3.BigNumber;
  2. require('chai')
  3. .use(require('chai-as-promised'))
  4. .use(require('chai-bignumber')(BigNumber))
  5. .should();
  6. const DetailedERC20Mock = artifacts.require('mocks/DetailedERC20Mock.sol');
  7. contract('DetailedERC20', accounts => {
  8. let detailedERC20 = null;
  9. const _name = 'My Detailed ERC20';
  10. const _symbol = 'MDT';
  11. const _decimals = 18;
  12. beforeEach(async function () {
  13. detailedERC20 = await DetailedERC20Mock.new(_name, _symbol, _decimals);
  14. });
  15. it('has a name', async function () {
  16. const name = await detailedERC20.name();
  17. name.should.be.equal(_name);
  18. });
  19. it('has a symbol', async function () {
  20. const symbol = await detailedERC20.symbol();
  21. symbol.should.be.equal(_symbol);
  22. });
  23. it('has an amount of decimals', async function () {
  24. const decimals = await detailedERC20.decimals();
  25. decimals.should.be.bignumber.equal(_decimals);
  26. });
  27. });