Created
April 7, 2018 04:45
-
-
Save EdsonAlcala/14ce25da89ccb0dc141b086e731eddb9 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 Organization = artifacts.require("Organization"); | |
| contract('Organization', (accounts) => { | |
| let contractInstance; | |
| const creator = accounts[0]; | |
| beforeEach(async function () { | |
| contractInstance = await Organization.new(4, 4, { from: creator }); | |
| }); | |
| describe("# addMember()", () => { | |
| it("should add a new member", async () => { | |
| //arrange | |
| let memberToAdd = accounts[1]; | |
| let transactionCall; | |
| let memberExist; | |
| //act | |
| transactionCall = await contractInstance.addMember.call(memberToAdd); | |
| await contractInstance.addMember(memberToAdd); | |
| memberExist = await contractInstance.members(memberToAdd); | |
| //assert | |
| assert.equal(transactionCall, true); | |
| assert.equal(memberExist, true); | |
| }) | |
| }) | |
| }); | |
| //For more information about Mocha test suites | |
| //https://gist.github.com/samwize/8877226#file-mocha-guide-to-testing-js-L53 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment