update example tests

pull/3094/head
Iuri Matias 7 years ago
parent 20975418d3
commit 6c6434a48f
  1. 5
      examples/simple_storage2_test.sol
  2. 8
      examples/simple_storage_test.sol

@ -25,10 +25,5 @@ contract MyTest2 {
return Assert.equal(foo.get(), 200, "initial value is not correct"); return Assert.equal(foo.get(), 200, "initial value is not correct");
} }
// TODO: the tests don't necessarily run in order
//function initialValueShouldBe400() public constant returns (bool) {
// return Assert.equal(foo.get(), 400, "initial value is not correct");
//}
} }

@ -4,11 +4,19 @@ import "./simple_storage.sol";
contract MyTest { contract MyTest {
SimpleStorage foo; SimpleStorage foo;
uint i = 0;
function beforeAll() { function beforeAll() {
foo = new SimpleStorage(); foo = new SimpleStorage();
} }
function beforeEach() {
if (i == 1) {
foo.set(200);
}
i += 1;
}
function initialValueShouldBe100() public { function initialValueShouldBe100() public {
Assert.equal(foo.get(), 100, "initial value is not correct"); Assert.equal(foo.get(), 100, "initial value is not correct");
} }

Loading…
Cancel
Save