dimanche 4 juin 2017

Should unit tests cover every possible case?

Suppose you are writing a custom Calendar class, I have a method that takes (Year, Month, Day) , should I write a unit test for every possible case type this method could face? for example for the month

  • Negative value
  • Value between 0 and 12
  • Value greater than 12

Then do the same for the Year and Day parameters?

Aucun commentaire:

Enregistrer un commentaire