Add tests for Openzeppelin dependencies of feat/v3-implementation#4
Conversation
There was a problem hiding this comment.
Context tests are interesting.
The tests are clean and well written. However, the approach I'd have taken is to directly inherit the Context in the test file. Otherwise, it is not composable. We need think of efficient ways of testing internal functions in such a way that when test files are utilized in other tests, the dependency test file do not need extra modification
rayedsikder
left a comment
There was a problem hiding this comment.
All the tests passed.
LGTM except the Ownable.t.sol contract which needs minor changes to make it composable and compatible with main contracts (Otherwise the tests will fail when it will be run in context of main ccp-contracts)
On a different note, we need think of efficient ways to test internal functions without compromising composability.
There was a problem hiding this comment.
Ownable.t.sol tests the abstract contract Ownable very well. However, it is not composable at this format because of use custom function names.
When Ownable is inherited the public and external functions are accessible to the inherited contract with the same names. Use of custom names transferOwnershipExternal & checkOwner reduces the composability.
The purpose of this OwnableTest contract would be to support main contracts, e.g - CampaignInfo. In that case, when with modified constructor parameters CampaignInfo will be created inside OwnableTest and transferOwnershipExternal & checkOwner will be called it will throw an error.
I would recommend to use the default public functions transferOwnership and owner. Similar to how you used renounceOwnership - which will work with any contract that inherits Ownable.
This pull request introduces Foundry tests for CCP v3-implementation. There are eight OpenZeppelin dependencies utilized in CCP v3-implementation . These tests primarily focus on the main functions used in feat/v3-implementation.
mechanism that can be triggered by an authorized account.
_safeMint