unit tests for exception