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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!