Add test for raise exception.