Question: Unit Testing JAVA public static string getTriangleType ( int a , int b , int c ) { if ( ! isValidTriangle ( a ,

Unit Testing
JAVA
public static string getTriangleType(int a, int b, int c){
if (!isValidTriangle(a,b,c){
throw new IllegalArgumentException("Not Valid Triangle");
}
if
return "Equilateral";
} else if
return "Isosceles";
} else {
return "Scalene";
}
}
What is the cyclomatic complexity for the getTriangleType method?
Write a unit test case for the getTriangleType method in Triangle class that would test the following path:
2-5a-7a-7b-8
The test case should look like the test cases you have written for your test programs in class (assertEquals with message).
 Unit Testing JAVA public static string getTriangleType(int a, int b, int

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!