Created
April 27, 2018 20:48
-
-
Save dangerousfood/547212bb7376de85526a3a508fab4cdb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SimpleStorage = artifacts.require("SimpleStorage") | |
contract('SimpleStorage', (accounts) => { | |
const [bob, alice] = accounts | |
it("should verify bob and alice's favorite numbers default to 0", async () => { | |
const ssContract = await SimpleStorage.deployed() | |
const bobNum = await ssContract.favoriteNumbers.call(bob) | |
assert.equal(bobNum, 0, | |
"bob's default value was non-zero") | |
const aliceNum = await ssContract.favoriteNumbers.call(alice) | |
assert.equal(aliceNum, 0, | |
"alice's default value was non-zero") | |
}) | |
it("should set bob's favorite number to 33", async () => { | |
const ssContract = await SimpleStorage.deployed() | |
ssContract.setFavorite(33, {from: bob}) | |
const newBobNum = await ssContract.favoriteNumbers.call(bob) | |
assert.equal(newBobNum, 30, | |
"bob's new value was not 33") | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment