Skip to content

Instantly share code, notes, and snippets.

@MrCrambo
Last active April 10, 2018 20:21
Show Gist options
  • Save MrCrambo/8550220477e9b126b8d15f8c6d662ed5 to your computer and use it in GitHub Desktop.
Save MrCrambo/8550220477e9b126b8d15f8c6d662ed5 to your computer and use it in GitHub Desktop.
contract('ExampleToken', accounts => {
beforeEach(async function() {
this.owner = accounts[0]
this.token = await ExampleToken.new()
})
it('all values should be set on constructor call', async function() {
const totalSupply = await this.token.totalSupply();
assert.equal(1000, totalSupply.valueOf(), "correct total supply should be set")
const balance = await this.token.balanceOf.call(this.owner)
assert.equal(1000, balance.valueOf(), "balance should be equal to total supply")
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment