Question: Junit test, how can I test the following code public MastermindModel() { // TODO Make the answer Random color = new Random(); int index, numOfSec=4;
Junit test, how can I test the following code
public MastermindModel() { // TODO Make the answer Random color = new Random(); int index, numOfSec=4; String[] c=colors; for(int i=0; i index=color.nextInt(c.length); results+=c[index]; } }
public char getColorAt(int index) { (first converted if stored as a number) */ char out = results.charAt(index); return out; //Just returning something to make sure the code compiles }
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
