Refactoring the testcase