Validator constructor and unit tests