Unit tests for error conditions.