parent
1cab524578
commit
3f49febf16
@ -0,0 +1,16 @@ |
|||||||
|
pragma solidity ^0.4.7; |
||||||
|
contract SimpleString { |
||||||
|
string public storedData; |
||||||
|
|
||||||
|
function SimpleString() public { |
||||||
|
storedData = "Hello"; |
||||||
|
} |
||||||
|
|
||||||
|
function set(string x) public { |
||||||
|
storedData = x; |
||||||
|
} |
||||||
|
|
||||||
|
function get() public view returns (string retVal) { |
||||||
|
return storedData; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
pragma solidity ^0.4.7; |
||||||
|
import "./tests.sol"; |
||||||
|
import "./simple_string.sol"; |
||||||
|
|
||||||
|
contract MyTest { |
||||||
|
SimpleString foo; |
||||||
|
|
||||||
|
function beforeAll() { |
||||||
|
foo = new SimpleString(); |
||||||
|
} |
||||||
|
|
||||||
|
function initialValueShouldBeHello() public constant returns (bool) { |
||||||
|
return Assert.equal(foo.get(), "Hello", "initial value is not correct"); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue