diff --git a/test/PurchaseToken.t.sol b/test/PurchaseToken.t.sol index 363c955..01d76ca 100644 --- a/test/PurchaseToken.t.sol +++ b/test/PurchaseToken.t.sol @@ -30,10 +30,22 @@ contract PurchaseTokenTest is Test { assertEq(token.symbol(), "PT"); } + function testAllowance() public { + assertEq(token.allowance(alice, bob), 0); + } + + function testBalanceOf() public { + assertEq(token.balanceOf(alice), 0); + } + function testDecimals() public { assertEq(token.decimals(), 18); } + function testTotalSupply() public { + assertEq(token.totalSupply(), 0); + } + function testMint() public { vm.deal(alice, 1 ether); assertEq(token.balanceOf(alice), 0); @@ -46,6 +58,12 @@ contract PurchaseTokenTest is Test { assertEq(token.totalSupply(), 1e19); } + function testMintInvalid() public { + vm.prank(address(0)); + vm.expectRevert("ERC20: mint to the zero address"); + token.mint(); + } + function testMintInsufficientFunds() public { vm.deal(alice, 0.01 ether); assertEq(token.balanceOf(alice), 0);