ProbabilityWithoutOverflownLevels extends Levels { @Override public void linesRemoved(int amount) { removedLinesWithoutOverflown += amount; super.linesRemoved(amount); } ProbabilityWithoutOverflownLevels(PlayerFigures queue); @Override void glassOverflown(); @Override void linesRemoved(int amount); GlassEvent nextLevelAcceptedCriteriaOnLinesRemovedEvent(int amount); int getRemovedLinesWithoutOverflown(); static final int LINES_REMOVED_FOR_NEXT_LEVEL; }
@Test public void shouldClearLinesRemovedCounterWhenLevelChanged() { levels.linesRemoved(20); assertEquals(1, levels.getCurrentLevelNumber()); assertLinesRemovedWithoutOverflown(0); levels.linesRemoved(10); assertLinesRemovedWithoutOverflown(10); }