tracks/java/exercises/pascals-triangle/src/test/java/PascalsTriangleTest.java in trackler-2.0.6.41 vs tracks/java/exercises/pascals-triangle/src/test/java/PascalsTriangleTest.java in trackler-2.0.6.42

- old
+ new

@@ -1,14 +1,19 @@ import org.junit.Test; import org.junit.Ignore; +import org.junit.Rule; +import org.junit.rules.ExpectedException; + import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; public class PascalsTriangleTest { - + @Rule + public ExpectedException thrown = ExpectedException.none(); + @Test public void testTriangleWithFourRows() { int[][] expectedOutput = new int[][]{ {1}, {1, 1}, @@ -70,10 +75,11 @@ assertEquals(false, PascalsTriangle.isTriangle(input)); } @Ignore - @Test(expected = IllegalArgumentException.class) + @Test public void testValidatesNotNegativeRows() { + thrown.expect(IllegalArgumentException.class); PascalsTriangle.computeTriangle(-1); } }