Answer the question
In order to leave comments, you need to log in
How to write to JUnitTest method?
Hello everyone, help me how to write a unit test, not when I didn’t use tests!
//
public static int getMenu() {
if (!scanner.hasNextInt()) {
System.out.println(scanner.next() + "Please enter correctly");
return getMenu();
}
int menu = scanner.nextInt();
if (menu < 1 || menu > 10) {
System. out. println("Please enter correctly");
return getMenu();
}
return menu;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question