示例#1
0
 /** Makes sure the ChessGameEngine initialized properly and is waiting for the user to click. */
 public void testInitialization() {
   assertNotNull(gameEngine);
   assertTrue(panel.getGameLog().getLastLog().contains("new chess" + " game"));
   assertEquals(gameEngine.getCurrentPlayer(), 1);
   assertFalse(gameEngine.playerHasLegalMoves(-1));
   assertFalse(gameEngine.isKingInCheck(false));
 }
示例#2
0
 /** Sets up the test harness by creating a panel and other necessary Chess objects. */
 public void setUp() {
   panel = new ChessPanel();
   gameEngine = panel.getGameEngine();
   board = panel.getGameBoard();
 }