wavesinaroom / my_odin_project_battleship

0 stars 0 forks source link

Ship isSunk function #3

Closed wavesinaroom closed 1 year ago

wavesinaroom commented 1 year ago

isSunk() should be a function that calculates it based on their length and the number of ‘hits’.

wavesinaroom commented 1 year ago

At this point, I've been able to test my current code manually so far but I feel it's time to incorporate mocks to perform tests better. for example, to test checkShipState, which turns isSunk to true under a condition, I triggered the hit function four times.