@Test public void testGetPieceLocation() { abg = MockData.abstractBoardGame(); Piece p = MockData.pieceFactory().createPawn(Color.BLACK); Location l = new Location(7, 7, 0); abg.addPiece(p, l); assert (abg.getByLocation(l).equals(p)); assert (abg.getByPiece(p).equals(l)); }
@Test public void testAbg_TR() { abg = MockData.abstractBoardGame(); Piece p = MockData.pieceFactory().createPawn(Color.BLACK); Location l1 = new Location(7, 7, 0); Location l2 = new Location(7, 6, 0); abg.addPiece(p, l1); abg.abg_TR(p, l1, l2); assert (abg.getByLocation(l1) == null); assert (abg.getByLocation(l2).equals(p)); }
@Test public void testToString() { abg = new AbstractBoardGame(8, 8, 2, MockData.pieceFactory()); Piece p = MockData.pieceFactory().createPawn(Color.BLACK); Location l = new Location(7, 7, 0); abg.addPiece(p, l); p = MockData.pieceFactory().createKing(Color.BLACK); l = new Location(2, 3, 0); abg.addPiece(p, l); p = MockData.pieceFactory().createObstacle(); l = new Location(1, 6, 0); abg.addPiece(p, l); System.out.print(abg.toString()); System.out.print(abg.toString(0)); }
@Test public void testSetAbstractBoard() { abg.setAbstractBoard( new AbstractBoard(MockData.CHESS_DIMENSION, MockData.CHESS_DIMENSION - 1, 1)); assertFalse(abg.getAbstractBoard().equals(MockData.abstractBoard())); assertTrue(abg.getByLocation(new Location(7, 7, 0)) == null); assertTrue(abg.getByLocation(new Location(6, 6, 0)) != null); }
@Test public void testAbstractBoardGameIntegerIntegerInteger() { abg = new AbstractBoardGame( MockData.CHESS_DIMENSION, MockData.CHESS_DIMENSION, MockData.CHESS_DIMENSION, MockData.pieceFactory()); }
@Test public void testGetAbstractBoard() { assertTrue(abg.getAbstractBoard().equals(MockData.abstractBoard())); }
@Test public void testAbstractBoardGameAbstractBoard() { abg = new AbstractBoardGame(MockData.abstractBoard(), MockData.pieceFactory()); }
@Before public void initialize() { abg = MockData.chessGame(); }