示例#1
0
 @Test
 public void testIsosceles() {
   Triangle t = new Triangle(20, 20, 30);
   String result = t.triangleType();
   assertEquals("Isosceles", result);
 }
示例#2
0
 @Test
 public void testInvalid() {
   Triangle t = new Triangle(2, 5, 7);
   String result = t.triangleType();
   assertEquals("The lengths of the triangles do not form a valid triangle!", result);
 }
示例#3
0
 @Test
 public void testEquilateral() {
   Triangle t = new Triangle(10, 10, 10);
   String result = t.triangleType();
   assertEquals("Equilateral", result);
 }
示例#4
0
 // TODO: CREATE MORE TESTS
 @Test
 public void testNegative() {
   Triangle t = new Triangle(10, -10, 2);
   String result = t.triangleType();
   assertEquals("At least one length is less than 0!", result);
 }
示例#5
0
 /**
  * We've already created a testScalene method. Please fill in testEquilateral, and additionally
  * create tests for Isosceles, Negative Sides, and Invalid sides
  */
 @Test
 public void testScalene() {
   Triangle t = new Triangle(30, 40, 50);
   String result = t.triangleType();
   assertEquals("Scalene", result);
 }