Add tests for object validation