Tests that determine whether both a method invocation and a constructor invocation throws the desired exception.
Overview
The tester also allows the user to test whether a method invocation by the given instance and with the given arguments throws the expected exception with the message the programmer expects. The tester will report every type of failure - when the method fails to throw exception, when the method throws and exception of a different type, when the method throws an exception of the correct type, but with a wrong message.
The tester also allows the user to test whether a constructor invocation for the given class and with the given arguments throws the expected exception with the message the programmer expects. The tester will report every type of failure - when the constructor fails to throw exception, when the constructor throws and exception of a different type, when the constructor throws an exception of the correct type, but with a wrong message.
The class ExamplesMethodExceptions and ExamplesConstructorExceptions contains all test cases.
Code sources
Here is the complete source code for this test suite.
You can also download the entire souce code as a zip file.