added unit tests for data validation