Skip to content

Instantly share code, notes, and snippets.

@alant
Created December 7, 2018 00:57
Show Gist options
  • Select an option

  • Save alant/3132877df9657482c44520d9c8917b45 to your computer and use it in GitHub Desktop.

Select an option

Save alant/3132877df9657482c44520d9c8917b45 to your computer and use it in GitHub Desktop.
var SimpleStorage = artifacts.require("./SimpleStorage.sol");
contract('SimpleStorage', function(accounts) {
it("...should start with the value 0.", async function() {
let simpleStorage = await SimpleStorage.deployed();
let storedData = await simpleStorage.storedData_();
assert.equal(storedData.valueOf(), 0, "0 wasn't stored in contract");
});
it("...should store the value 89.", async function() {
let simpleStorage = await SimpleStorage.deployed();
await simpleStorage.set(89, {from: accounts[0]});
let storedData = await simpleStorage.storedData_();
assert.equal(storedData.valueOf(), 89, "89 wasn't stored in contract");
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment