Skip to content
Snippets Groups Projects
Commit a500c2bf authored by Suzette J Person's avatar Suzette J Person
Browse files

added test cases for exception handling

parent 14c7031d
No related branches found
No related tags found
No related merge requests found
......@@ -78,8 +78,19 @@ public class ParityTest extends TestCase {
public void testUnknownEven() {
assertEquals(assemble(
"Enter parity of multiplier: Enter parity of multiplicand: The parity of the product of an EVEN number and an UNKNOWN number is EVEN."),
runMain("EVEN", "UNKNOWN"));
"Enter parity of multiplier: Enter parity of multiplicand: The parity of the product of an UNKNOWN number and an EVEN number is EVEN."),
runMain("UNKNOWN", "EVEN"));
}
public void testExceptionInMultiplier() {
assertEquals(assemble(
"Enter parity of multiplier: Parity must be one of EVEN, ODD, or UNKNOWN."),
runMain("FOO", "EVEN"));
}
public void testExceptionInMultiplicand() {
assertEquals(assemble(
"Enter parity of multiplier: Enter parity of multiplicand: Parity must be one of EVEN, ODD, or UNKNOWN."),
runMain("EVEN", "BAR"));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment