Skip to content

Instantly share code, notes, and snippets.

@alexroan
Created March 21, 2020 17:11
Show Gist options
  • Save alexroan/8a5015b0424d497317013660e7d27d4a to your computer and use it in GitHub Desktop.
Save alexroan/8a5015b0424d497317013660e7d27d4a to your computer and use it in GitHub Desktop.
truffle-tests/TestEntryPoint.sol
pragma solidity >=0.5.0;
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../../../contracts/Background.sol";
import "../../../contracts/EntryPoint.sol";
contract TestEntryPoint {
// Ensure that dependency injection working correctly
function testItHasCorrectBackground() public {
Background backgroundTest = new Background();
EntryPoint entryPoint = new EntryPoint(address(backgroundTest));
address expected = address(backgroundTest);
address target = entryPoint.getBackgroundAddress();
Assert.equal(target, expected, "It should set the correct background");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment