Game implements IGame { @Override public IBoard getBoard() { return itsBoard; } Game(final int dimX, final int dimY, final int bombs, final IBoardMiner miner); private  Game(final GameState state, final IBoardMiner miner); @Override void addListener(final IMinesGameListener listener); @Override IBoard getBoard(); @Override int getBombCount(); @Override void onRequestFlag(final IField fieldInterface); @Override void onRequestOpen(final IField fieldInterface); @Override boolean isStarted(); @Override boolean isRunning(); @Override void removeListener(final IMinesGameListener listener); @Override String toString(); static Game createFromState(final GameState state, final IBoardMiner miner); GameState getState(); @Override IStopWatch getWatch(); @Override void tickWatch(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testOpenBombDoesNotOpenNeighbors() { openAt(1, 0, itsGame2by2); assertEquals(true, itsGame2by2.getBoard().getField(1, 0).isOpen()); assertEquals(true, itsGame2by2.getBoard().getField(1, 0).isExploded()); assertEquals(false, itsGame2by2.getBoard().getField(0, 0).isOpen()); assertEquals(false, itsGame2by2.getBoard().getField(0, 1).isOpen()); assertEquals(false, itsGame2by2.getBoard().getField(1, 1).isOpen()); }
@Test public void testOpenNeighborsOnOpenEmptyField() { Game game = new Game(3, 3, 1, new TestBoardMiner(new boolean[][]{ {true, false, false}, {false, false, false}, {false, false, false}})); openAt(2, 0, game); assertEquals(8, game.getBoard().getOpenCount()); }