|
|
@@ -33,6 +33,13 @@ public class TriangleTest {
|
|
33
|
33
|
|
|
34
|
34
|
assertFalse(triangle.isEquilateral());
|
|
35
|
35
|
}
|
|
|
36
|
+
|
|
|
37
|
+ @Ignore("Remove to run test")
|
|
|
38
|
+ @Test
|
|
|
39
|
+ public void trianglesWithNoSizeAreIllegal() throws TriangleException {
|
|
|
40
|
+ expectedException.expect(TriangleException.class);
|
|
|
41
|
+ new Triangle(0, 0, 0);
|
|
|
42
|
+ }
|
|
36
|
43
|
|
|
37
|
44
|
@Ignore("Remove to run test")
|
|
38
|
45
|
@Test
|
|
|
@@ -52,16 +59,16 @@ public class TriangleTest {
|
|
52
|
59
|
|
|
53
|
60
|
@Ignore("Remove to run test")
|
|
54
|
61
|
@Test
|
|
55
|
|
- public void isoscelesTrianglesHaveFirstAndLastSidesEqual() throws TriangleException {
|
|
56
|
|
- Triangle triangle = new Triangle(4, 3, 4);
|
|
|
62
|
+ public void isoscelesTrianglesHaveTwoFirstSidesEqual() throws TriangleException {
|
|
|
63
|
+ Triangle triangle = new Triangle(4, 4, 3);
|
|
57
|
64
|
|
|
58
|
65
|
assertTrue(triangle.isIsosceles());
|
|
59
|
66
|
}
|
|
60
|
|
-
|
|
|
67
|
+
|
|
61
|
68
|
@Ignore("Remove to run test")
|
|
62
|
69
|
@Test
|
|
63
|
|
- public void isoscelesTrianglesHaveTwoFirstSidesEqual() throws TriangleException {
|
|
64
|
|
- Triangle triangle = new Triangle(4, 4, 3);
|
|
|
70
|
+ public void isoscelesTrianglesHaveFirstAndLastSidesEqual() throws TriangleException {
|
|
|
71
|
+ Triangle triangle = new Triangle(4, 3, 4);
|
|
65
|
72
|
|
|
66
|
73
|
assertTrue(triangle.isIsosceles());
|
|
67
|
74
|
}
|
|
|
@@ -81,6 +88,13 @@ public class TriangleTest {
|
|
81
|
88
|
|
|
82
|
89
|
assertFalse(triangle.isIsosceles());
|
|
83
|
90
|
}
|
|
|
91
|
+
|
|
|
92
|
+ @Ignore("Remove to run test")
|
|
|
93
|
+ @Test
|
|
|
94
|
+ public void testSidesThatViolateTriangleInequalityAreNotIsoscelesEvenIfTwoAreEqual() throws TriangleException {
|
|
|
95
|
+ expectedException.expect(TriangleException.class);
|
|
|
96
|
+ new Triangle(1, 1, 3);
|
|
|
97
|
+ }
|
|
84
|
98
|
|
|
85
|
99
|
@Ignore("Remove to run test")
|
|
86
|
100
|
@Test
|
|
|
@@ -113,33 +127,19 @@ public class TriangleTest {
|
|
113
|
127
|
|
|
114
|
128
|
assertFalse(triangle.isScalene());
|
|
115
|
129
|
}
|
|
116
|
|
-
|
|
117
|
|
- @Ignore("Remove to run test")
|
|
118
|
|
- @Test
|
|
119
|
|
- public void verySmallTrianglesCanBeScalene() throws TriangleException {
|
|
120
|
|
- Triangle triangle = new Triangle(0.5, 0.4, 0.6);
|
|
121
|
|
-
|
|
122
|
|
- assertTrue(triangle.isScalene());
|
|
123
|
|
- }
|
|
124
|
|
-
|
|
|
130
|
+
|
|
125
|
131
|
@Ignore("Remove to run test")
|
|
126
|
132
|
@Test
|
|
127
|
|
- public void trianglesWithNoSizeAreIllegal() throws TriangleException {
|
|
|
133
|
+ public void testSidesThatViolateTriangleInequalityAreNotScaleneEvenIfTheyAreAllDifferent() throws TriangleException {
|
|
128
|
134
|
expectedException.expect(TriangleException.class);
|
|
129
|
|
- new Triangle(0, 0, 0);
|
|
|
135
|
+ new Triangle(7, 3, 2);
|
|
130
|
136
|
}
|
|
131
|
137
|
|
|
132
|
138
|
@Ignore("Remove to run test")
|
|
133
|
139
|
@Test
|
|
134
|
|
- public void trianglesViolatingTriangleInequalityAreIllegal() throws TriangleException {
|
|
135
|
|
- expectedException.expect(TriangleException.class);
|
|
136
|
|
- new Triangle(1, 1, 3);
|
|
137
|
|
- }
|
|
|
140
|
+ public void verySmallTrianglesCanBeScalene() throws TriangleException {
|
|
|
141
|
+ Triangle triangle = new Triangle(0.5, 0.4, 0.6);
|
|
138
|
142
|
|
|
139
|
|
- @Ignore("Remove to run test")
|
|
140
|
|
- @Test
|
|
141
|
|
- public void trianglesViolatingTriangleInequalityAreIllegal2() throws TriangleException {
|
|
142
|
|
- expectedException.expect(TriangleException.class);
|
|
143
|
|
- new Triangle(7, 3, 2);
|
|
|
143
|
+ assertTrue(triangle.isScalene());
|
|
144
|
144
|
}
|
|
145
|
145
|
}
|