N
N
niknamme2019-10-13 13:54:30
Java
niknamme, 2019-10-13 13:54:30

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 question

Ask a Question

731 491 924 answers to any question