コード例 #1
0
 @Test
 public void testGetRightNode() {
   Node node = board.getNode(SUSPECTS[0], Direction.NORTH);
   assertEquals("Should be 8", 8, node.getPoint().x);
   assertEquals("Should be 24", 24, node.getPoint().y);
   assertTrue("Should be able to move back south", node.canMove(Direction.SOUTH));
 }
コード例 #2
0
 @Test
 public void testMovePlayerSomewhere() {
   assertEquals("Should be 8", 8, SUSPECTS[0].getGridX());
   assertEquals("Should be 25", 25, SUSPECTS[0].getGridY());
   gameEngine.setSuspectOnNode(board.getNode(new Point(11, 10)), SUSPECTS[0]);
   assertEquals("Should be 11", 11, SUSPECTS[0].getGridX());
   assertEquals("Should be 10", 10, SUSPECTS[0].getGridY());
 }
コード例 #3
0
 @Test
 public void testFindPath() {
   Node node = board.getNode(SUSPECTS[0], Direction.NORTH);
   assertFalse("Should not be a path", node.isPath());
   board.findPaths(SUSPECTS[0], 2);
   assertTrue("Should be a path", node.isPath());
   board.clearPaths();
   assertFalse("Should not be a path", node.isPath());
 }