I am given with a java code and i have to write test cases so that 100% coverage can be obtained. But, the code given is written in such a way that one of the "if" statement will never be true. We cannot change the code, still we have to achieve 100% code coverage. How to do that. The tool is only helper, its mentioned in one of the post, but what if anyhow we need to do that.The code is-`
public double getArea(int side1, int side2, int side3 ) {
String type = determineTriangleType(side1+"", side2+".1", side3+"");
double area;
//Different way of calculation for Equilateral
if(type.equals("Equilateral"))
{
area =(Math.sqrt(3)/4)*side1 *side2;
}` else{.....}
I am not able to give the test case for which above "if" is true.
The determineTriangleType method ispublic String determineTriangleType(String side1, String side2, String side3 ) {......Some Processing.....}