diff --git a/tests/edu/caltech/cs2/project02/ChooserTests.java b/tests/edu/caltech/cs2/project02/ChooserTests.java index 0e2d91561f199a7490e45085c6e9b5b3304bc527..4f4de4137ea4231c934b519e76c7b1ed7e44005e 100644 --- a/tests/edu/caltech/cs2/project02/ChooserTests.java +++ b/tests/edu/caltech/cs2/project02/ChooserTests.java @@ -77,7 +77,7 @@ public class ChooserTests { @Test public void testExceptionsViolatedInRandomConstructor() { Constructor c = Reflection.getConstructor(RandomHangmanChooser.class, int.class, int.class); - assertThrows(IllegalStateException.class, () -> Reflection.newInstance(c, -1, 3)); + assertThrows(IllegalArgumentException.class, () -> Reflection.newInstance(c, -1, 3)); assertThrows(IllegalArgumentException.class, () -> Reflection.newInstance(c, 3, -1)); assertThrows(IllegalStateException.class, () -> Reflection.newInstance(c, Integer.MAX_VALUE, 3)); } @@ -193,7 +193,7 @@ public class ChooserTests { @Test public void testExceptionsViolatedInEvilConstructor() { Constructor c = Reflection.getConstructor(EvilHangmanChooser.class, int.class, int.class); - assertThrows(IllegalStateException.class, () -> Reflection.newInstance(c, -1, 3)); + assertThrows(IllegalArgumentException.class, () -> Reflection.newInstance(c, -1, 3)); assertThrows(IllegalArgumentException.class, () -> Reflection.newInstance(c, 3, -1)); assertThrows(IllegalStateException.class, () -> Reflection.newInstance(c, Integer.MAX_VALUE, 3)); }