Browse Source

Merge pull request #69 from federicobond/tokenmock-totalsupply

Fill totalSupply in StandardTokenMock
Manuel Aráoz 9 years ago
parent
commit
e1dcab29de
2 changed files with 12 additions and 0 deletions
  1. 1 0
      contracts/test-helpers/StandardTokenMock.sol
  2. 11 0
      test/StandardToken.js

+ 1 - 0
contracts/test-helpers/StandardTokenMock.sol

@@ -6,6 +6,7 @@ contract StandardTokenMock is StandardToken {
 
   function StandardTokenMock(address initialAccount, uint initialBalance) {
     balances[initialAccount] = initialBalance;
+    totalSupply = initialBalance;
   }
 
 }

+ 11 - 0
test/StandardToken.js

@@ -1,5 +1,16 @@
 contract('StandardToken', function(accounts) {
 
+  it("should return the correct totalSupply after construction", function(done) {
+    return StandardTokenMock.new(accounts[0], 100)
+      .then(function(token) {
+        return token.totalSupply();
+      })
+      .then(function(totalSupply) {
+        assert.equal(totalSupply, 100);
+      })
+      .then(done);
+  })
+
   it("should return the correct allowance amount after approval", function(done) {
     var token;
     return StandardTokenMock.new()