Added unit tests using mock