Add tests to validate exceptions