@Test(expected = IllegalArgumentException.class) public void testInvalidIndex() { tested = new DeleteCanvasControlPointCommand(edge, -1); tested.allow(canvasHandler); }
@Override public CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context) { ControlPointValidations.checkDeleteControlPoint(getViewControlPoints(context, candidate), index); return CanvasCommandResultBuilder.SUCCESS; }
DeleteCanvasControlPointCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context) { ControlPointValidations.checkDeleteControlPoint(getViewControlPoints(context, candidate), index); return CanvasCommandResultBuilder.SUCCESS; } }
DeleteCanvasControlPointCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context) { ControlPointValidations.checkDeleteControlPoint(getViewControlPoints(context, candidate), index); return CanvasCommandResultBuilder.SUCCESS; } DeleteCanvasControlPointCommand(final Edge candidate,
                                           final int index); }
DeleteCanvasControlPointCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context) { ControlPointValidations.checkDeleteControlPoint(getViewControlPoints(context, candidate), index); return CanvasCommandResultBuilder.SUCCESS; } DeleteCanvasControlPointCommand(final Edge candidate,
                                           final int index); @Override CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); @Override String toString(); }
DeleteCanvasControlPointCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context) { ControlPointValidations.checkDeleteControlPoint(getViewControlPoints(context, candidate), index); return CanvasCommandResultBuilder.SUCCESS; } DeleteCanvasControlPointCommand(final Edge candidate,
                                           final int index); @Override CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); @Override String toString();  }