Inside my smart contract I'm having this function:
function addPerson(string memory _name, uint256 _favoriteNumber) public {
people.push(People(_favoriteNumber, _name));
nameToFavoriteNumber[_name] = _favoriteNumber;
}
I want to write a test
in hardhat to get my coverage 100%.
people[]
array and nameToFavoriteNumber
mapping are public.
uint256 favoriteNumber;
struct People {
uint256 favoriteNumber;
string name;
}
People[] public people;
How can I achieve this without making any changes in smart contract?