|
|
@@ -1,15 +1,19 @@
|
|
1
|
|
-
|
|
2
|
1
|
import java.util.Arrays;
|
|
3
|
2
|
import java.util.List;
|
|
4
|
3
|
import org.junit.Test;
|
|
|
4
|
+import org.junit.Ignore;
|
|
|
5
|
+import org.junit.Rule;
|
|
|
6
|
+import org.junit.rules.ExpectedException;
|
|
5
|
7
|
|
|
6
|
8
|
import static org.junit.Assert.assertEquals;
|
|
7
|
9
|
import static org.junit.Assert.assertFalse;
|
|
8
|
10
|
import static org.junit.Assert.assertNotNull;
|
|
9
|
|
-import org.junit.Ignore;
|
|
10
|
11
|
|
|
11
|
12
|
public class SeriesTest {
|
|
12
|
|
-
|
|
|
13
|
+
|
|
|
14
|
+ @Rule
|
|
|
15
|
+ public ExpectedException thrown = ExpectedException.none();
|
|
|
16
|
+
|
|
13
|
17
|
@Test
|
|
14
|
18
|
public void hasDigitsShort() {
|
|
15
|
19
|
Series sut = new Series("01234");
|
|
|
@@ -146,9 +150,10 @@ public class SeriesTest {
|
|
146
|
150
|
assertEquals(expected, actual);
|
|
147
|
151
|
}
|
|
148
|
152
|
|
|
149
|
|
- @Test(expected = IllegalArgumentException.class)
|
|
|
153
|
+ @Test
|
|
150
|
154
|
@Ignore
|
|
151
|
155
|
public void throwsAnErrorIfNotEnoughDigitsToSlice() {
|
|
|
156
|
+ thrown.expect(IllegalArgumentException.class);
|
|
152
|
157
|
new Series("01032987583").slices(12);
|
|
153
|
158
|
}
|
|
154
|
159
|
}
|