remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/libs/remix-tests/examples/simple_storage2_test.sol

29 lines
605 B

6 years ago
pragma solidity ^0.5.0;
import "remix_tests.sol";
import "./simple_storage.sol";
contract MyTest2 {
SimpleStorage storage foo;
uint storage i = 0;
function beforeAll() public {
foo = new SimpleStorage();
}
function beforeEach() public {
if (i == 1) {
foo.set(200);
}
i += 1;
}
6 years ago
function initialValueShouldBe100() public view returns (bool) {
7 years ago
return Assert.equal(foo.get(), 100, "initial value is not correct");
}
6 years ago
function initialValueShouldBe200() public view returns (bool) {
7 years ago
return Assert.equal(foo.get(), 200, "initial value is not correct");
}
}