unit tests for exceptions