Add unit tests for error messages