### Question:
Scores implements PlayerScores { @Override public Integer getScore() { return score; } Scores(int startScore, Settings settings); @Override Integer getScore(); @Override int clear(); @Override void event(Object event); @Override void update(Object score);  }### Answer:
@Test public void shouldCollectScores() { scores = new Scores(140, parameters); minesweeperDestroyMine(); minesweeperDestroyMine(); minesweeperDestroyMine(); minesweeperDestroyMine(); minesweeperForgetCharge(); minesweeperNoMoreCharge(); minesweeperKillOnMine(); Integer gameover = parameters.getParameter("Game over penalty").type(Integer.class).getValue(); Integer forgot = parameters.getParameter("Forgot penalty").type(Integer.class).getValue(); assertEquals(140 + 1 + 2 + 3 + 4 - forgot - 2* gameover, scores.getScore()); }
@Test public void shouldStillZeroAfterDead() { scores = new Scores(0, parameters); minesweeperKillOnMine(); assertEquals(0, scores.getScore()); }
@Test public void shouldStillZeroAfterForgotCharge() { scores = new Scores(0, parameters); minesweeperForgetCharge(); assertEquals(0, scores.getScore()); }
@Test public void shouldStillZeroAfterNoMoreCharge() { scores = new Scores(0, parameters); minesweeperNoMoreCharge(); assertEquals(0, scores.getScore()); }
@Test public void shouldDestroyMinesCountStartsFromZeroAfterDead() { scores = new Scores(0, parameters); minesweeperDestroyMine(); minesweeperKillOnMine(); minesweeperDestroyMine(); assertEquals(1, scores.getScore()); }
@Test public void shouldDecreaseMinesCountAfterForgotCharge() { scores = new Scores(0, parameters); minesweeperDestroyMine(); minesweeperDestroyMine(); minesweeperForgetCharge(); minesweeperDestroyMine(); assertEquals(1, scores.getScore()); }
@Test public void shouldMinesCountIsZeroAfterManyTimesForgotCharge() { scores = new Scores(0, parameters); minesweeperDestroyMine(); minesweeperDestroyMine(); minesweeperForgetCharge(); minesweeperForgetCharge(); minesweeperForgetCharge(); minesweeperDestroyMine(); assertEquals(1, scores.getScore()); }
@Test public void shouldScore_whenWin() { scores = new Scores(0, parameters); minesweeperWin(); Integer score = parameters.getParameter("Win score").type(Integer.class).getValue(); assertEquals(score, scores.getScore()); }
@Test public void shouldScore_whenClearBoard() { scores = new Scores(0, parameters); minesweeperClearBoard(); Integer score = parameters.getParameter("Clear board score").type(Integer.class).getValue(); assertEquals(score, scores.getScore()); }