add unit test cases for exception