Test Cases for error handling