@Test public void testMoreBlackPieces() { Othello o = new Othello(); o.restart(Piece.BLACK); o.move(2, 3); assertTrue(o.moreBlackPieces()); }
@Test public void testPieceFlip() { Othello o = new Othello(); o.restart(Piece.BLACK); o.move(2, 3); assertEquals(Piece.BLACK, o.getEntry(3, 3)); }
@Test public void testValidMove() { Othello o = new Othello(); o.restart(Piece.BLACK); boolean valid = o.validMove(Piece.BLACK, 2, 3); assertTrue(valid); valid = o.validMove(Piece.BLACK, 5, 3); }
@Test public void testRestart() { Othello o = new Othello(); o.restart(Piece.BLACK); assertTrue(o.getTurn().equals(Piece.BLACK)); assertEquals(o.getEntry(3, 4), Piece.BLACK); assertEquals(o.getEntry(3, 3), Piece.WHITE); }
@Test public void testCopyConstructor() { Othello o1 = new Othello(); o1.restart(Piece.BLACK); Othello o2 = new Othello(o1); o2.setTurn(Piece.WHITE); assertEquals(Piece.BLACK, o1.getTurn()); assertEquals(Piece.WHITE, o2.getTurn()); }
@Test public void testCount() { Othello o = new Othello(); o.restart(Piece.BLACK); assertEquals(2, o.count(Piece.WHITE)); }