I have a question about a JUnit test case which I am building for a simple RPN calculator.
Here is the test case, I basically want to test what happens when you increment MAX_VALUE
@Test public void testPlusExtreme() throws CalculatorException{ fc.enter(Double.MAX_VALUE); fc.enter(1.0); fc.plus(); Double result = fc.result(); //Some JUnit assertion }
But what do I add to ensure that the Overflow exception is received?
Is it try and catch?
Thanks a lot!