commit
b068d9844b
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,12 @@ |
||||
pragma solidity ^0.4.7; |
||||
contract SimpleString { |
||||
string public storedData; |
||||
|
||||
function SimpleString() public { |
||||
storedData = "Hello world!"; |
||||
} |
||||
|
||||
function get() public view returns (string retVal) { |
||||
return storedData; |
||||
} |
||||
} |
@ -0,0 +1,23 @@ |
||||
pragma solidity ^0.4.7; |
||||
import "./tests.sol"; |
||||
import "./simple_string.sol"; |
||||
|
||||
contract StringTest { |
||||
SimpleString foo; |
||||
|
||||
function beforeAll() { |
||||
foo = new SimpleString(); |
||||
} |
||||
|
||||
function initialValueShouldBeHello() public constant returns (bool) { |
||||
return Assert.equal(foo.get(), "Hello world!", "initial value is not correct"); |
||||
} |
||||
|
||||
function valueShouldNotBeHelloWorld() public constant returns (bool) { |
||||
return Assert.notEqual(foo.get(), "Hello wordl!", "initial value is not correct"); |
||||
} |
||||
|
||||
function valueShouldBeHelloWorld() public constant returns (bool) { |
||||
return Assert.equal(foo.get(), "Hello wordl!", "initial value is not correct"); |
||||
} |
||||
} |
Loading…
Reference in new issue