Added tests for exception handling using the mock library.