public static void takeAnswers(int answerNumber){
if(answerNumber<0){
throw new IllegalStateException();
}
Scanner answer = new Scanner(System.in);
testResponse = answer.next().charAt(0);
while(!(validateAnswer(testResponse, answerNumber))){
Question.inValidInput();
}
}
so i making this quiz in java and i am just stuck on the junit testing.
"Also, How are we suppose to test for nested methods?
Can we alter the value of a local variable (declared inside the method itself), since it's using scanner and thus waits for a user input and therefore the test just waits forever. "
So basically no matter what value I give to the testResponse , the test still waits for the scanner.
and thus the program just waits there forever.