refactor ExceptionTest and add a couple more test cases