Question: PlayerRandom.java class contents: package ca . yorku.eecs 3 3 1 1 . a 1 ; import java.util.ArrayList; import java.util.Random; / * * * PlayerRandom makes
PlayerRandom.java class contents: package cayorku.eecsa; import java.util.ArrayList; import java.util.Random; PlayerRandom makes a move by first determining all possible moves that this player can make, putting them in an ArrayList, and then randomly choosing one of them. @author ilir public class PlayerRandom private Random rand new Random; public Move getMove return null; The test cases are saved in three classes. The test case classes are: MoveTest.java, OthelloBoardTest.java and OthelloTest.java. Don't change those test case classes but use them as a reference to understand how to modify and implement those classes to test all of these test cases below. MoveTest.java class contents which shouldn't be changed: package cayorku.eecsatest; import static org.junit.Assert.; import org.junit.Test; import static org.junit.Assert.; import org.junit.Before; import org.junit.Test; import cayorku.eecsaMove; public class MoveTest Move move; @Before public void setUp throws Exception movenew Move; @Test public void testGetRow assertEqualsgetRow move.getRow; @Test public void testGetCol assertEqualsgetCol move.getCol; @Test public void testToString assertEqualstoString move.toString; OthelloBoardTest.java class contents which shouldn't be changed: package cayorku.eecsatest; import static org.junit.Assert.; import org.junit.Before; import org.junit.Test; import cayorku.eecsaMove; import cayorku.eecsaOthello; import cayorku.eecsaOthelloBoard; public class OthelloBoardTest OthelloBoard board; Move moves new Move new Move new Move new Move new Move new Move new Move new Move new Move; @Before public void setUp throws Exception boardnew OthelloBoardOthelloDIMENSION; x board board.move OthelloBoard.P; board.move OthelloBoard.P; board.move OthelloBoard.P; board.move OthelloBoard.P; Board now looks like OXXXOOOX X: O: X moves next row: col: X makes move XXXXXXOOX X: O: O moves next @Test public void testOthelloBoard OthelloBoard bnew OthelloBoardOthelloDIMENSION; Check initial position assertEqualsInitial tokens Pbget OthelloBoard.P; assertEqualsInitial tokens Pbget OthelloBoard.P; assertEqualsInitial tokens Pbget OthelloBoard.P; assertEqualsInitial tokens Pbget OthelloBoard.P; forint row;row
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
