Ejemplo n.º 1
0
 /** Test of setLocation method, of class Player. */
 @Test
 public void testSetLocation() {
   System.out.println("setLocation");
   int[] location = {2, 2};
   Player instance =
       new Player(
           new PlayerInfo("String", 0, "String"),
           new RouteRunner(new int[] {1, 1}, "String", "String"));
   instance.setLocation(location);
   int[] expResult = {2, 2};
   int[] result = instance.getLocation();
   assertArrayEquals(expResult, result);
 }
Ejemplo n.º 2
0
 /** Test of getLocation method, of class Player. */
 @Test
 public void testGetLocation() {
   System.out.println("getLocation");
   PlayerInfo pManning = new PlayerInfo("Peyton Manning", 18);
   int[] alkupaikka1 = {5, 5};
   RouteRunner testiOff = new RouteRunner(alkupaikka1, "879987", "Q");
   Player qb = new Player(pManning, testiOff);
   qb.setLocation(alkupaikka1);
   Player instance = qb;
   int[] expResult = new int[] {5, 5};
   int[] result = instance.getLocation();
   assertArrayEquals(expResult, result);
 }
 @Test
 public void testGameTokensOnGoAtGameStart() {
   List<Player> listOfPlayers = new ArrayList<>();
   GameSetup gameSetup = new GameSetup();
   listOfPlayers = gameSetup.initializePlayers(6);
   boolean didItFail = false;
   for (Player player : listOfPlayers) {
     int location = player.getLocation();
     if (location != 0) {
       didItFail = true;
     }
   }
   assertFalse(didItFail);
 }