New: unit tests for testing is_valid method.