Leaping Gorilla Testing 4.2.15
The When attribute is used to specify the entry point for your test and marks the method which will be executed by the LeapingGorilla.Testing library. This release adds an optional parameter to the When attribute:
DoNotRethrowExceptions
.
Any exceptions that occur during execution of your When method will be unwrapped and stored in the ThrownException
property. You can then Assert against the ThrownException
property in your tests to ensure that an Exception did (or did not) occur.
Additionally if DoNotRethrowExceptions
is set to true then the exception will not be rethrown - it will just be swallowed meaning no need for you to wrap your statements in the When method with a try/catch