我有这个 if-else 语句,我想编写一个 J 单元测试来测试每一行是否正确。有任何想法吗?
public class Testings {
public static int computeValue(int x, int y, int z) {
int value = 0;
if ( x == y )
value = x + 1;
else if (( x > y) && ( z == 0))
value = y + 2;
else
value = z;
return value;
}
}