Add validation command

I finally understand why the mock object didn't worked. I updated the tests and added new tests to cover all situations.