Skip to content

Instantly share code, notes, and snippets.

@athlona64
Created March 26, 2021 03:42
Show Gist options
  • Save athlona64/846b743a9baf6bfedb1edd50267d48ff to your computer and use it in GitHub Desktop.
Save athlona64/846b743a9baf6bfedb1edd50267d48ff 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.17+commit.d19bba13.js&optimize=true&runs=200&gist=
// this line is added to create a gist. Empty file is not allowed.
pragma solidity >=0.4.22 <0.6.0;
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment