-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestZombieFactory.sol
42 lines (33 loc) · 1.16 KB
/
TestZombieFactory.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*pragma solidity ^0.4.24;
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../contracts/ZombieFactory.sol";
contract TestZombieFactory {
function testCreateInitialZombie() private {
ZombieFactory randomZombie = ZombieFactory(DeployedAddresses.ZombieFactory());
randomZombie.createRandomZombie("test2");
// Assert.equal(1, 1, "First number set should be 24.");
}
/* function testGoodZombieName() private {
ZombieFactory randomZombie = new ZombieFactory();
ThrowProxy throwproxy = new ThrowProxy(address(randomZombie));
ZombieFactory(address(throwproxy)).createRandomZombie("test2");
bool r = throwproxy.execute.gas(200000)();
Assert.isTrue(r, "Should be true because is should throw!");
}
}
// Proxy contract for testing throws
contract ThrowProxy {
address public target;
bytes data;
function ThrowProxy(address _target) public {
target = _target;
}
//prime the data using the fallback function.
function() public {
data = msg.data;
}
function execute() public returns (bool) {
return target.call(data);
}
} */