mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-03-03 08:39:45 +01:00
Legger til manglende mellomrom mellom paranteser og krøllparanteser
This commit is contained in:
parent
17d6495e67
commit
1c47b627af
@ -24,12 +24,12 @@ public class PositionTest {
|
|||||||
testPosition6 = new Position(3, 3);
|
testPosition6 = new Position(3, 3);
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void testGetXPosition(){
|
public void testGetXPosition() {
|
||||||
assertEquals(3,testPosition1.getXCoordinate());
|
assertEquals(3,testPosition1.getXCoordinate());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetYPosition(){
|
public void testGetYPosition() {
|
||||||
assertEquals(4,testPosition1.getYCoordinate());
|
assertEquals(4,testPosition1.getYCoordinate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,14 +139,14 @@ public class BoardTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void setRobotPowerDownStatus(){
|
public void setRobotPowerDownStatus() {
|
||||||
Robot testrobot = robotListforpowerdown.get(0);
|
Robot testrobot = robotListforpowerdown.get(0);
|
||||||
assertEquals(false , testrobot.isInPowerDown());
|
assertEquals(false , testrobot.isInPowerDown());
|
||||||
boardforpowerdown.setPowerDown(RobotID.ROBOT_1,true);
|
boardforpowerdown.setPowerDown(RobotID.ROBOT_1,true);
|
||||||
assertEquals(true , testrobot.isInPowerDown());
|
assertEquals(true , testrobot.isInPowerDown());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void executRobotPowerDown(){
|
public void executRobotPowerDown() {
|
||||||
Robot testrobot = robotListforpowerdown.get(1);
|
Robot testrobot = robotListforpowerdown.get(1);
|
||||||
boardforpowerdown.setPowerDown(RobotID.ROBOT_2,true);
|
boardforpowerdown.setPowerDown(RobotID.ROBOT_2,true);
|
||||||
testrobot.setDamageTaken(4);
|
testrobot.setDamageTaken(4);
|
||||||
@ -155,7 +155,7 @@ public class BoardTest {
|
|||||||
assertEquals(0,testrobot.getDamageTaken());
|
assertEquals(0,testrobot.getDamageTaken());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void repairRobotOnRepairTile(){
|
public void repairRobotOnRepairTile() {
|
||||||
Robot testrobot = robotListforpowerdown.get(2);
|
Robot testrobot = robotListforpowerdown.get(2);
|
||||||
testrobot.setDamageTaken(4);
|
testrobot.setDamageTaken(4);
|
||||||
assertEquals(4,testrobot.getDamageTaken());
|
assertEquals(4,testrobot.getDamageTaken());
|
||||||
@ -164,21 +164,21 @@ public class BoardTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void robotHitByLaserGetsDamaged(){
|
public void robotHitByLaserGetsDamaged() {
|
||||||
Robot testRobot = robotListforlaser.get(7);
|
Robot testRobot = robotListforlaser.get(7);
|
||||||
assertEquals(0, testRobot.getDamageTaken());
|
assertEquals(0, testRobot.getDamageTaken());
|
||||||
boardforlaser.fireAllLasers();
|
boardforlaser.fireAllLasers();
|
||||||
assertNotEquals(0,testRobot.getDamageTaken());
|
assertNotEquals(0,testRobot.getDamageTaken());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void laserBlockedByWallDoesNotDamageRobot(){
|
public void laserBlockedByWallDoesNotDamageRobot() {
|
||||||
Robot testRobot = robotListforlaser.get(0);
|
Robot testRobot = robotListforlaser.get(0);
|
||||||
assertEquals(0, testRobot.getDamageTaken());
|
assertEquals(0, testRobot.getDamageTaken());
|
||||||
boardforlaser.fireAllLasers();
|
boardforlaser.fireAllLasers();
|
||||||
assertEquals(0,testRobot.getDamageTaken());
|
assertEquals(0,testRobot.getDamageTaken());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void laserBlockedByRobotDoesNotDamageOtherRobot(){
|
public void laserBlockedByRobotDoesNotDamageOtherRobot() {
|
||||||
Robot testRobot1 = robotListforlaser.get(1);
|
Robot testRobot1 = robotListforlaser.get(1);
|
||||||
Robot testRobot2 = robotListforlaser.get(2);
|
Robot testRobot2 = robotListforlaser.get(2);
|
||||||
testRobot2.setFacingDirection(Direction.EAST);
|
testRobot2.setFacingDirection(Direction.EAST);
|
||||||
@ -189,14 +189,14 @@ public class BoardTest {
|
|||||||
assertNotEquals(0,testRobot2.getDamageTaken());
|
assertNotEquals(0,testRobot2.getDamageTaken());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void doubleLaserDamage(){
|
public void doubleLaserDamage() {
|
||||||
Robot testRobot = robotListforlaser.get(6);
|
Robot testRobot = robotListforlaser.get(6);
|
||||||
assertEquals(0, testRobot.getDamageTaken());
|
assertEquals(0, testRobot.getDamageTaken());
|
||||||
boardforlaser.fireAllLasers();
|
boardforlaser.fireAllLasers();
|
||||||
assertEquals(2,testRobot.getDamageTaken());
|
assertEquals(2,testRobot.getDamageTaken());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void robotGetsHitByTwoLasers(){
|
public void robotGetsHitByTwoLasers() {
|
||||||
Robot testRobot = robotListforlaser.get(3);
|
Robot testRobot = robotListforlaser.get(3);
|
||||||
assertEquals(0, testRobot.getDamageTaken());
|
assertEquals(0, testRobot.getDamageTaken());
|
||||||
boardforlaser.fireAllLasers();
|
boardforlaser.fireAllLasers();
|
||||||
@ -397,12 +397,12 @@ public class BoardTest {
|
|||||||
assertTrue(tileTypeList.containsAll(tileTypeListResult) && tileTypeListResult.containsAll(tileTypeList));
|
assertTrue(tileTypeList.containsAll(tileTypeListResult) && tileTypeListResult.containsAll(tileTypeList));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <K> boolean checkIfAllElementsAreOfSpecificWallType(List<BoardElementContainer<Wall>> elemList, K WallType) {
|
private <K> boolean checkIfAllElementsAreOfSpecificWallType(List<BoardElementContainer<Wall>> elemList, K WallType) {
|
||||||
Predicate<BoardElementContainer<Wall>> pred = (element) -> element.getElement().getWallType() == WallType;
|
Predicate<BoardElementContainer<Wall>> pred = (element) -> element.getElement().getWallType() == WallType;
|
||||||
elemList.removeIf(pred);
|
elemList.removeIf(pred);
|
||||||
return 0 == elemList.size();
|
return 0 == elemList.size();
|
||||||
}
|
}
|
||||||
public <K> boolean checkIfAllElementsAreOfSpecificTileType(List<BoardElementContainer<Tile>> elemList, K TileType) {
|
private <K> boolean checkIfAllElementsAreOfSpecificTileType(List<BoardElementContainer<Tile>> elemList, K TileType) {
|
||||||
Predicate<BoardElementContainer<Tile>> pred = (element) -> element.getElement().getTileType() == TileType;
|
Predicate<BoardElementContainer<Tile>> pred = (element) -> element.getElement().getTileType() == TileType;
|
||||||
elemList.removeIf(pred);
|
elemList.removeIf(pred);
|
||||||
return 0 == elemList.size();
|
return 0 == elemList.size();
|
||||||
|
@ -19,17 +19,17 @@ public class RobotTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRobotGetDamageOnInitializedRobot(){
|
public void testRobotGetDamageOnInitializedRobot() {
|
||||||
assertEquals(0, testRobot.getDamageTaken());
|
assertEquals(0, testRobot.getDamageTaken());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRobotGetPlayerId(){
|
public void testRobotGetPlayerId() {
|
||||||
assertEquals(RobotID.ROBOT_6, testRobot.getRobotId());
|
assertEquals(RobotID.ROBOT_6, testRobot.getRobotId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRobotGetBackupOnInitializedRobot(){
|
public void testRobotGetBackupOnInitializedRobot() {
|
||||||
assertEquals(robotPosition, testRobot.getBackupPosition());
|
assertEquals(robotPosition, testRobot.getBackupPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ public class RobotTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRobotGetPositionOnInitializedRobot(){
|
public void testRobotGetPositionOnInitializedRobot() {
|
||||||
assertEquals(robotPosition, testRobot.getPosition());
|
assertEquals(robotPosition, testRobot.getPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ public class RobotTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRobotIsInPowerDownOnInitializedRobot(){
|
public void testRobotIsInPowerDownOnInitializedRobot() {
|
||||||
assertEquals(false, testRobot.isInPowerDown());
|
assertEquals(false, testRobot.isInPowerDown());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,27 +7,27 @@ import org.junit.Test;
|
|||||||
|
|
||||||
public class WallTest {
|
public class WallTest {
|
||||||
@Test
|
@Test
|
||||||
public void testWallGetWallTypeNormal(){
|
public void testWallGetWallTypeNormal() {
|
||||||
Wall testGetWall = new Wall(WallType.WALL_NORMAL, Direction.NORTH);
|
Wall testGetWall = new Wall(WallType.WALL_NORMAL, Direction.NORTH);
|
||||||
assertEquals(WallType.WALL_NORMAL, testGetWall.getWallType());
|
assertEquals(WallType.WALL_NORMAL, testGetWall.getWallType());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void testWallGetWallTypeCorner(){
|
public void testWallGetWallTypeCorner() {
|
||||||
Wall testGetWall = new Wall(WallType.WALL_CORNER, Direction.NORTH);
|
Wall testGetWall = new Wall(WallType.WALL_CORNER, Direction.NORTH);
|
||||||
assertEquals(WallType.WALL_CORNER, testGetWall.getWallType());
|
assertEquals(WallType.WALL_CORNER, testGetWall.getWallType());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void testWallGetWallTypeLaserSingle(){
|
public void testWallGetWallTypeLaserSingle() {
|
||||||
Wall testGetWall = new Wall(WallType.WALL_LASER_SINGLE, Direction.NORTH);
|
Wall testGetWall = new Wall(WallType.WALL_LASER_SINGLE, Direction.NORTH);
|
||||||
assertEquals(WallType.WALL_LASER_SINGLE, testGetWall.getWallType());
|
assertEquals(WallType.WALL_LASER_SINGLE, testGetWall.getWallType());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void testWallGetDirectionNorth(){
|
public void testWallGetDirectionNorth() {
|
||||||
Wall testGetWall = new Wall(WallType.WALL_CORNER, Direction.NORTH);
|
Wall testGetWall = new Wall(WallType.WALL_CORNER, Direction.NORTH);
|
||||||
assertEquals(Direction.NORTH, testGetWall.getDirection());
|
assertEquals(Direction.NORTH, testGetWall.getDirection());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void testWallGetDirectionEast(){
|
public void testWallGetDirectionEast() {
|
||||||
Wall testGetWall = new Wall(WallType.WALL_CORNER, Direction.EAST);
|
Wall testGetWall = new Wall(WallType.WALL_CORNER, Direction.EAST);
|
||||||
assertEquals(Direction.EAST, testGetWall.getDirection());
|
assertEquals(Direction.EAST, testGetWall.getDirection());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user