@Test public void executesToggleCommand() { Point topLeft = new Point(getRandomCoordinate(), getRandomCoordinate()); Point bottomRight = new Point(topLeft.x + getRandomCoordinate(), topLeft.y + getRandomCoordinate()); grid.changeLights(Command.TOGGLE, topLeft, bottomRight); verifyCommands(topLeft, bottomRight, (x, y) -> verify(grid).toggle(x, y)); }
@Test public void executesTurnOffCommand() { Point topLeft = new Point(getRandomCoordinate(), getRandomCoordinate()); Point bottomRight = new Point(topLeft.x + getRandomCoordinate(), topLeft.y + getRandomCoordinate()); grid.changeLights(Command.TURN_OFF, topLeft, bottomRight); verifyCommands(topLeft, bottomRight, (x, y) -> verify(grid).turnOff(x, y)); }