File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,24 @@ contract GasTankDepositorTest is Test {
2626 _gasTankDepositorImpl = new GasTankDepositor (rpcService, MAXIMUM_DEPOSIT);
2727 }
2828
29+ //=======================TESTS FOR CONSTRUCTOR=======================
30+
31+ function testConstructorRevertsWhenRpcServiceIsZeroAddress () public {
32+ vm.expectRevert (abi.encodeWithSelector (GasTankDepositor.RPCServiceNotSet.selector , ZERO_ADDRESS));
33+ new GasTankDepositor (ZERO_ADDRESS, MAXIMUM_DEPOSIT);
34+ }
35+
36+ function testConstructorRevertsWhenMaximumDepositIsZero () public {
37+ vm.expectRevert (abi.encodeWithSelector (GasTankDepositor.MaximumDepositNotMet.selector , 0 , 0 ));
38+ new GasTankDepositor (rpcService, 0 );
39+ }
40+
41+ function testConstructorSetsVariables () public view {
42+ assertEq (_gasTankDepositorImpl.RPC_SERVICE (), rpcService);
43+ assertEq (_gasTankDepositorImpl.MAXIMUM_DEPOSIT (), MAXIMUM_DEPOSIT);
44+ assertEq (_gasTankDepositorImpl.GAS_TANK_ADDRESS (), address (_gasTankDepositorImpl));
45+ }
46+
2947 //=======================TESTS=======================
3048
3149 function testSetsDelegationCodeAtAddress () public {
You can’t perform that action at this time.
0 commit comments