added method getPlayerId in robot class and tested it in Robottest

This commit is contained in:
Tobydrama 2020-02-22 14:23:38 +01:00
parent 98c0ceed15
commit 64dca4d9f7
2 changed files with 12 additions and 0 deletions

View File

@ -98,4 +98,12 @@ public class Robot {
return backupPosition;
}
/**
* Gets the identifier of the players controlling the robot
* @return player identifier
*/
public int getPlayerId(){
return playerId;
}
}

View File

@ -19,6 +19,10 @@ public class RobotTest {
assertEquals(0, testRobot.getDamage());
}
@Test
public void testRobotGetPlayerId(){
assertEquals(6, testRobot.getPlayerId());
}
@Test
public void testRobotGetBackupOnInitializedRobot(){
assertEquals(robotPosition, testRobot.getBackupPosition());
}