Added Implementation For Test Cases

 Refactered the test Cases using mock