From 7bdf508c01835e79dcd93acf59a2918d1123ba4a Mon Sep 17 00:00:00 2001 From: torlunjen Date: Tue, 21 Apr 2020 16:08:15 +0200 Subject: [PATCH] =?UTF-8?q?Legger=20til=20test=20for=20at=20roboter=20som?= =?UTF-8?q?=20blir=20skubbet=20ut=20av=20brettet=20av=20transportb=C3=A5nd?= =?UTF-8?q?=20d=C3=B8r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: gabrielmagnus --- .../fiasko/roborally/objects/PhaseTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/java/inf112/fiasko/roborally/objects/PhaseTest.java b/src/test/java/inf112/fiasko/roborally/objects/PhaseTest.java index 6416e75..c948e56 100644 --- a/src/test/java/inf112/fiasko/roborally/objects/PhaseTest.java +++ b/src/test/java/inf112/fiasko/roborally/objects/PhaseTest.java @@ -334,5 +334,21 @@ public class PhaseTest { assertNull(board.getRobotOnPosition(new Position(7, 7))); } + @Test + public void robotOnConveyorBeltFacingOutOfMapMovesAndDies() { + List robots = new ArrayList<>(); + List players = new ArrayList<>(); + robots.add(new Robot(RobotID.ROBOT_1, new Position(7, 0))); + players.add(new Player(RobotID.ROBOT_1, "Player 1")); + try { + board = BoardLoaderUtil.loadBoard("boards/test_board.txt", robots); + Phase testPhase = new Phase(board, players, 0, null); + testPhase.moveAllConveyorBelts(); + } catch (IOException | InterruptedException e) { + e.printStackTrace(); + } + assertFalse(board.isRobotAlive(RobotID.ROBOT_1)); + assertNull(board.getRobotOnPosition(new Position(7, 0))); + } }