Modify test case after refactoring code