Refactoring test cases to simulate user input