tracks/java/exercises/series/src/test/java/SeriesTest.java in trackler-2.1.0.53 vs tracks/java/exercises/series/src/test/java/SeriesTest.java in trackler-2.1.0.54
- old
+ new
@@ -9,59 +9,59 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
public class SeriesTest {
-
+
@Rule
- public ExpectedException thrown = ExpectedException.none();
-
+ public ExpectedException expectedException = ExpectedException.none();
+
@Test
public void hasDigitsShort() {
Series series = new Series("01234");
List<Integer> expected = Arrays.asList(0, 1, 2, 3, 4);
List<Integer> actual = series.getDigits();
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void hasDigitsLong() {
Series series = new Series("0123456789");
List<Integer> expected = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
List<Integer> actual = series.getDigits();
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void keepsTheDigitOrderIfReversed() {
Series series = new Series("9876543210");
List<Integer> expected = Arrays.asList(9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
List<Integer> actual = series.getDigits();
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void keepsArbitraryDigitOrder() {
Series series = new Series("936923468");
List<Integer> expected = Arrays.asList(9, 3, 6, 9, 2, 3, 4, 6, 8);
List<Integer> actual = series.getDigits();
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void canSliceByOne() {
Series series = new Series("01234");
List<List<Integer>> expected = Arrays.asList(
Arrays.asList(0),
Arrays.asList(1),
@@ -73,12 +73,12 @@
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void canSliceByTwo() {
Series series = new Series("98273463");
List<List<Integer>> expected = Arrays.asList(
Arrays.asList(9, 8),
Arrays.asList(8, 2),
@@ -92,12 +92,12 @@
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void canSliceByThree() {
Series series = new Series("01234");
List<List<Integer>> expected = Arrays.asList(
Arrays.asList(0, 1, 2),
Arrays.asList(1, 2, 3),
@@ -107,12 +107,12 @@
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void canSliceByThreeWithDuplicateDigits() {
Series series = new Series("31001");
List<List<Integer>> expected = Arrays.asList(
Arrays.asList(3, 1, 0),
Arrays.asList(1, 0, 0),
@@ -122,12 +122,12 @@
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void canSliceByFour() {
Series series = new Series("91274");
List<List<Integer>> expected = Arrays.asList(
Arrays.asList(9, 1, 2, 7),
Arrays.asList(1, 2, 7, 4)
@@ -136,12 +136,12 @@
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void canSliceByFive() {
Series series = new Series("81228");
List<List<Integer>> expected = Arrays.asList(
Arrays.asList(8, 1, 2, 2, 8)
);
@@ -149,12 +149,12 @@
assertNotNull(actual);
assertFalse(actual.isEmpty());
assertEquals(expected, actual);
}
- @Test
@Ignore("Remove to run test")
+ @Test
public void throwsAnErrorIfNotEnoughDigitsToSlice() {
- thrown.expect(IllegalArgumentException.class);
+ expectedException.expect(IllegalArgumentException.class);
new Series("01032987583").slices(12);
}
}