Added unit tests with validation