Skip to content

Commit

Permalink
test: improve BFactory.sol (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAustrian authored May 3, 2024
1 parent 4cc0e63 commit eab5cd4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/unit/BFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,23 @@ contract BFactory_Unit_NewBPool is Base {
/**
* @notice Test that event is emitted
*/
function test_Emit_Log() public {
function test_Emit_Log(address _randomCaller) public {

Check warning on line 59 in test/unit/BFactory.t.sol

View workflow job for this annotation

GitHub Actions / Lint Commit Messages

Function name must be in mixedCase
vm.assume(_randomCaller != VM_ADDRESS);
vm.expectEmit(true, true, true, true);
address _expectedPoolAddress = vm.computeCreateAddress(address(bFactory), 1);
emit BFactory.LOG_NEW_POOL(owner, _expectedPoolAddress);
vm.prank(owner);
emit BFactory.LOG_NEW_POOL(_randomCaller, _expectedPoolAddress);
vm.prank(_randomCaller);
bFactory.newBPool();
}

/**
* @notice Test that msg.sender is set as the controller
*/
function test_Set_Controller() public {
vm.prank(owner);
BPool _pool = new BPool();
assertEq(owner, _pool.getController());
function test_Set_Controller(address _randomCaller) public {

Check warning on line 71 in test/unit/BFactory.t.sol

View workflow job for this annotation

GitHub Actions / Lint Commit Messages

Function name must be in mixedCase
vm.assume(_randomCaller != VM_ADDRESS);
vm.prank(_randomCaller);
BPool _pool = bFactory.newBPool();
assertEq(_randomCaller, _pool.getController());
}

/**
Expand Down

0 comments on commit eab5cd4

Please sign in to comment.