Question: [Java] Junit testing case How am I supposed to deal with scanner in junit? Here are my methods I want to test. Scanner scan =
[Java] Junit testing case
How am I supposed to deal with scanner in junit?
Here are my methods I want to test.
Scanner scan = new Scanner(System.in).useDelimiter(" "); public String prompt_FirstName() { System.out.println("First Name:"); String firstName = scan.next(); return firstName; } public int prompt_Zip() { System.out.println("Zip:"); int zip = Integer.parseInt(scan.next()); return zip; } Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
