Skip to content

Instantly share code, notes, and snippets.

@abhinavmsra
Created May 24, 2019 03:26
Show Gist options
  • Save abhinavmsra/a61f84a01c021d8f25e395609479f170 to your computer and use it in GitHub Desktop.
Save abhinavmsra/a61f84a01c021d8f25e395609479f170 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.8+commit.23d335f2.js&optimize=true&gist=
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "./ballot.sol";
contract test3 {
Ballot ballotToTest;
function beforeAll () public {
ballotToTest = new Ballot(2);
}
function checkWinningProposal () public {
ballotToTest.vote(1);
Assert.equal(ballotToTest.winningProposal(), uint(1), "1 should be the winning proposal");
}
function checkWinninProposalWithReturnValue () public view returns (bool) {
return ballotToTest.winningProposal() == 1;
}
}
// specify solidity version
pragma solidity >=0.4.22 <0.6.0;
// initialize contract
contract Hello {
string public message;
function updateMessage(string memory _message) public {
message = _message;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment