From fd7f401fd377e0d06cdd4a400c7e54c564f5d25b Mon Sep 17 00:00:00 2001 From: Adam Blank <blank@caltech.edu> Date: Tue, 15 Jan 2019 22:40:58 -0800 Subject: [PATCH] Update ChooserTests.java --- tests/edu/caltech/cs2/project02/ChooserTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/edu/caltech/cs2/project02/ChooserTests.java b/tests/edu/caltech/cs2/project02/ChooserTests.java index 0e2d915..4f4de41 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)); } -- GitLab