From 6c6434a48f9b92cd845ecf9711941e6551c28729 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 25 May 2018 10:54:51 -0400 Subject: [PATCH] update example tests --- examples/simple_storage2_test.sol | 5 ----- examples/simple_storage_test.sol | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/simple_storage2_test.sol b/examples/simple_storage2_test.sol index 9c5765efce..0c199f9b03 100644 --- a/examples/simple_storage2_test.sol +++ b/examples/simple_storage2_test.sol @@ -25,10 +25,5 @@ contract MyTest2 { 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"); - //} - } diff --git a/examples/simple_storage_test.sol b/examples/simple_storage_test.sol index f95df21cc0..ec780ae85d 100644 --- a/examples/simple_storage_test.sol +++ b/examples/simple_storage_test.sol @@ -4,11 +4,19 @@ import "./simple_storage.sol"; contract MyTest { SimpleStorage foo; + uint i = 0; function beforeAll() { foo = new SimpleStorage(); } + function beforeEach() { + if (i == 1) { + foo.set(200); + } + i += 1; + } + function initialValueShouldBe100() public { Assert.equal(foo.get(), 100, "initial value is not correct"); }