Refactor the validateParameters method.

* Add unit test
* Add parameter for vars
Rename the validateParameters method to validateVars.