Added unit test to check errors messages