Question: I need JUnit 4 tests for this program: import java.util.Random; import java.util.Scanner; public class DeckHelp { static String DeckChoice; static String List; public static void
I need JUnit tests for this program:
import java.util.Random;
import java.util.Scanner;
public class DeckHelp
static String DeckChoice;
static String List;
public static void main
String
args
Scanner sc
new Scanner
System
in
;
System.out.println
Please enter which function you'd like
Random or List
:
;
String FunctionChoice
sc
nextLine
;
if
FunctionChoice
equals
Random
FunctionChoiceequals
random
RandomDeck
;
else if
FunctionChoice
equals
List
FunctionChoiceequals
list
DeckList
;
else
System.out.println
Invalid Input. Please restart the program."
;
public static String RandomDeck
Random Rand
new Random
;
int DeckNum
RandnextInt
;
if
DeckNum
DeckChoice
Rapid;
System.out.println
You will run Rapid today. Make them fear the bunnies."
;
if
DeckNum
DeckChoice
Hunters;
System.out.println
You will run Hunters today. Overwhelm the board with bodies."
;
if
DeckNum
DeckChoice
Imperial;
System.out.println
You will run Imperial today. Hit the funny Dragon Mode into ST Paildramon combo again."
;
if
DeckNum
DeckChoice
Gallant;
System.out.println
Finish Gallant and run it you coward."
;
return DeckChoice;
public static String DeckList
Scanner sc
new Scanner
System
in
;
System.out.println
Please enter which deck you'd like to see
Rapid
Imperial Hunters, or Gallant
:
;
String ListChoice
sc
nextLine
;
if
ListChoice
equals
Rapid
ListChoiceequals
rapid
System.out.println
List
;
List
Rapid;
else if
ListChoice
equals
Imperial
ListChoiceequals
imperial
System.out.println
List
;
List
Imperial;
else if
ListChoice
equals
Hunters
ListChoiceequals
hunters
System.out.println
List
;
List
Hunters;
else if
ListChoice
equals
Gallant
ListChoiceequals
gallant
System.out.println
List
;
List
Gallant;
else
System.out.println
Invalid Input. Please restart the program."
;
return List;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
