@Test public void testIsShootingAllowed() throws Exception { GameModel testModel = new GameModel(); testModel.setShootingAllowed(true); assertTrue(testModel.isShootingAllowed()); }
@Test public void testReset() throws Exception { GameModel testModel = new GameModel(); testModel.setShootingAllowed(false); testModel.setState(GameModel.State.PLAYING); testModel.getShots().clear(); testModel.getShips().clear(); testModel.getOpponentShots().clear(); testModel.getFlags().clear(); testModel.setOpponent(null); assertTrue( testModel.getState().equals(GameModel.State.PLAYING) && !testModel.isShootingAllowed() && testModel.getShots().isEmpty() && testModel.getFlags().isEmpty() && testModel.getShips().isEmpty() && testModel.getOpponentShots().isEmpty() && testModel.getOpponent() == null); }