Hi,
I have a question on method stubbing. Let's say I want to generate test cases for a method 'testMe(int x, int y)'. And 'testMe()' calls another method 'halfValue(int x)'. I do not want JDart to go inside 'halfValue()' method. Is there anything in JDart which can stub 'halfValue()' ?
public void testMe(int x, int y){
//do something
int z = halfValue(y);
if(z > 10 /* && few more conditions */){
//do something
}else{
//do something
}
//do something
}
public int halfValue(int x){
return x/2;
}
Please note: the halfValue() method works on the input 'y' and the condition in testMe() is based on the returned value from halfValue() method.
Thanks,
S. R. Giri