Commit 02c51234 authored by Iuri Matias's avatar Iuri Matias

update example tests

parent ca847b53
...@@ -25,10 +25,5 @@ contract MyTest2 { ...@@ -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"; ...@@ -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");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment