Currently I am working in a legacy code. I have introduced a new method to a class. This class does not have a corresponding test class. The method I introduced let's called it isValidState.
This method will only return a boolean considersing some of the states(properties in source class)
Ex
boolean isValidState(){
return a && b && c;(a ,b,c are properties of the source class)
}
To test this method I am thinking of having 8 test methods.(since there can be 8 valid combinations).
Since source class does not have a test class i have to write a new one which is fine. But in future i might need to add more methods like this to the source class and my Test class will grow heavily and become a very lengthy class.
So to avoid that is it correct to have multiple test classes which will test the functionalities of one source class ? Or is there a better way to have a structured test class/s for one single source class
Thanks in advance
Aucun commentaire:
Enregistrer un commentaire