|
|
@@ -11,7 +11,7 @@ public class TriangleTest {
|
|
11
|
11
|
public final ExpectedException thrown = ExpectedException.none();
|
|
12
|
12
|
|
|
13
|
13
|
@Test
|
|
14
|
|
- public void equilateralTriangleHaveEqualSides() throws Exception {
|
|
|
14
|
+ public void equilateralTriangleHaveEqualSides() throws TriangleException {
|
|
15
|
15
|
Triangle triangle = new Triangle(2, 2, 2);
|
|
16
|
16
|
|
|
17
|
17
|
assertEquals(TriangleKind.EQUILATERAL, triangle.getKind());
|
|
|
@@ -19,7 +19,7 @@ public class TriangleTest {
|
|
19
|
19
|
|
|
20
|
20
|
@Ignore
|
|
21
|
21
|
@Test
|
|
22
|
|
- public void largerEquilateralTrianglesAlsoHaveEqualSides() throws Exception {
|
|
|
22
|
+ public void largerEquilateralTrianglesAlsoHaveEqualSides() throws TriangleException {
|
|
23
|
23
|
Triangle triangle = new Triangle(10, 10, 10);
|
|
24
|
24
|
|
|
25
|
25
|
assertEquals(TriangleKind.EQUILATERAL, triangle.getKind());
|
|
|
@@ -27,7 +27,7 @@ public class TriangleTest {
|
|
27
|
27
|
|
|
28
|
28
|
@Ignore
|
|
29
|
29
|
@Test
|
|
30
|
|
- public void isoscelesTrianglesHaveLastTwoSidesEqual() throws Exception {
|
|
|
30
|
+ public void isoscelesTrianglesHaveLastTwoSidesEqual() throws TriangleException {
|
|
31
|
31
|
Triangle triangle = new Triangle(3, 4, 4);
|
|
32
|
32
|
|
|
33
|
33
|
assertEquals(TriangleKind.ISOSCELES, triangle.getKind());
|
|
|
@@ -35,7 +35,7 @@ public class TriangleTest {
|
|
35
|
35
|
|
|
36
|
36
|
@Ignore
|
|
37
|
37
|
@Test
|
|
38
|
|
- public void isoscelesTrianglesHaveFirstAndLastSidesEqual() throws Exception {
|
|
|
38
|
+ public void isoscelesTrianglesHaveFirstAndLastSidesEqual() throws TriangleException {
|
|
39
|
39
|
Triangle triangle = new Triangle(4, 3, 4);
|
|
40
|
40
|
|
|
41
|
41
|
assertEquals(TriangleKind.ISOSCELES, triangle.getKind());
|
|
|
@@ -43,7 +43,7 @@ public class TriangleTest {
|
|
43
|
43
|
|
|
44
|
44
|
@Ignore
|
|
45
|
45
|
@Test
|
|
46
|
|
- public void isoscelesTrianglesHaveTwoFirstSidesEqual() throws Exception {
|
|
|
46
|
+ public void isoscelesTrianglesHaveTwoFirstSidesEqual() throws TriangleException {
|
|
47
|
47
|
Triangle triangle = new Triangle(4, 4, 3);
|
|
48
|
48
|
|
|
49
|
49
|
assertEquals(TriangleKind.ISOSCELES, triangle.getKind());
|
|
|
@@ -51,7 +51,7 @@ public class TriangleTest {
|
|
51
|
51
|
|
|
52
|
52
|
@Ignore
|
|
53
|
53
|
@Test
|
|
54
|
|
- public void isoscelesTrianglesHaveInFactExactlyTwoSidesEqual() throws Exception {
|
|
|
54
|
+ public void isoscelesTrianglesHaveInFactExactlyTwoSidesEqual() throws TriangleException {
|
|
55
|
55
|
Triangle triangle = new Triangle(10, 10, 2);
|
|
56
|
56
|
|
|
57
|
57
|
assertEquals(TriangleKind.ISOSCELES, triangle.getKind());
|
|
|
@@ -59,7 +59,7 @@ public class TriangleTest {
|
|
59
|
59
|
|
|
60
|
60
|
@Ignore
|
|
61
|
61
|
@Test
|
|
62
|
|
- public void scaleneTrianglesHaveNoEqualSides() throws Exception {
|
|
|
62
|
+ public void scaleneTrianglesHaveNoEqualSides() throws TriangleException {
|
|
63
|
63
|
Triangle triangle = new Triangle(3, 4, 5);
|
|
64
|
64
|
|
|
65
|
65
|
assertEquals(TriangleKind.SCALENE, triangle.getKind());
|
|
|
@@ -67,7 +67,7 @@ public class TriangleTest {
|
|
67
|
67
|
|
|
68
|
68
|
@Ignore
|
|
69
|
69
|
@Test
|
|
70
|
|
- public void scaleneTrianglesHaveNoEqualSidesAtLargerScaleEither() throws Exception {
|
|
|
70
|
+ public void scaleneTrianglesHaveNoEqualSidesAtLargerScaleEither() throws TriangleException {
|
|
71
|
71
|
Triangle triangle = new Triangle(10, 11, 12);
|
|
72
|
72
|
|
|
73
|
73
|
assertEquals(TriangleKind.SCALENE, triangle.getKind());
|
|
|
@@ -75,7 +75,7 @@ public class TriangleTest {
|
|
75
|
75
|
|
|
76
|
76
|
@Ignore
|
|
77
|
77
|
@Test
|
|
78
|
|
- public void scaleneTrianglesHaveNoEqualSidesInDescendingOrderEither() throws Exception {
|
|
|
78
|
+ public void scaleneTrianglesHaveNoEqualSidesInDescendingOrderEither() throws TriangleException {
|
|
79
|
79
|
Triangle triangle = new Triangle(5, 4, 2);
|
|
80
|
80
|
|
|
81
|
81
|
assertEquals(TriangleKind.SCALENE, triangle.getKind());
|
|
|
@@ -83,7 +83,7 @@ public class TriangleTest {
|
|
83
|
83
|
|
|
84
|
84
|
@Ignore
|
|
85
|
85
|
@Test
|
|
86
|
|
- public void verySmallTrianglesAreLegal() throws Exception {
|
|
|
86
|
+ public void verySmallTrianglesAreLegal() throws TriangleException {
|
|
87
|
87
|
Triangle triangle = new Triangle(0.4, 0.6, 0.3);
|
|
88
|
88
|
|
|
89
|
89
|
assertEquals(TriangleKind.SCALENE, triangle.getKind());
|
|
|
@@ -91,35 +91,35 @@ public class TriangleTest {
|
|
91
|
91
|
|
|
92
|
92
|
@Ignore
|
|
93
|
93
|
@Test
|
|
94
|
|
- public void trianglesWithNoSizeAreIllegal() throws Exception {
|
|
|
94
|
+ public void trianglesWithNoSizeAreIllegal() throws TriangleException {
|
|
95
|
95
|
thrown.expect(TriangleException.class);
|
|
96
|
96
|
new Triangle(0, 0, 0);
|
|
97
|
97
|
}
|
|
98
|
98
|
|
|
99
|
99
|
@Ignore
|
|
100
|
100
|
@Test
|
|
101
|
|
- public void trianglesWithNegativeSidesAreIllegal() throws Exception {
|
|
|
101
|
+ public void trianglesWithNegativeSidesAreIllegal() throws TriangleException {
|
|
102
|
102
|
thrown.expect(TriangleException.class);
|
|
103
|
103
|
new Triangle(3, 4, -5);
|
|
104
|
104
|
}
|
|
105
|
105
|
|
|
106
|
106
|
@Ignore
|
|
107
|
107
|
@Test
|
|
108
|
|
- public void trianglesViolatingTriangleInequalityAreIllegal() throws Exception {
|
|
|
108
|
+ public void trianglesViolatingTriangleInequalityAreIllegal() throws TriangleException {
|
|
109
|
109
|
thrown.expect(TriangleException.class);
|
|
110
|
110
|
new Triangle(1, 1, 3);
|
|
111
|
111
|
}
|
|
112
|
112
|
|
|
113
|
113
|
@Ignore
|
|
114
|
114
|
@Test
|
|
115
|
|
- public void trianglesViolatingTriangleInequalityAreIllegal2() throws Exception {
|
|
|
115
|
+ public void trianglesViolatingTriangleInequalityAreIllegal2() throws TriangleException {
|
|
116
|
116
|
thrown.expect(TriangleException.class);
|
|
117
|
117
|
new Triangle(2, 4, 2);
|
|
118
|
118
|
}
|
|
119
|
119
|
|
|
120
|
120
|
@Ignore
|
|
121
|
121
|
@Test
|
|
122
|
|
- public void trianglesViolatingTriangleInequalityAreIllegal3() throws Exception {
|
|
|
122
|
+ public void trianglesViolatingTriangleInequalityAreIllegal3() throws TriangleException {
|
|
123
|
123
|
thrown.expect(TriangleException.class);
|
|
124
|
124
|
new Triangle(7, 3, 2);
|
|
125
|
125
|
}
|