/**
* Simulates a dragging operation for resizing on the NW corner.
*/
public void testDragResizeNw() {
Point2D origin = new Point2D.Double(0, 0);
Dimension2D minimumSize = new DoubleDimension(20, 20);
// start dragging somewhere in the NW handle (2-, 5-)
selection.startDragging(1, 3);
assertTrue(selection.isDragging());
// make it a little bigger
mockNode.expects(atLeastOnce()).method("getMinimumSize").
will(returnValue(minimumSize));
selection.updatePosition(-10.0, -10.0);
// and draw it
Mock mockDrawingContext = mock(DrawingContext.class);
// don't forget that sizes are truncated to the local system'
Constraint[] params = {eq(-9.0), eq(-8.0), eq(331.0), eq(433.0), NULL};
mockDrawingContext.expects(once()).method("drawRectangle").
with(params);
selection.draw((DrawingContext) mockDrawingContext.proxy());
// stop dragging
mockOperations.expects(once()).method("resizeElement").
with(eq(selection.getElement()), eq(new Point2D.Double(-9.0, -8.0)),
eq(new DoubleDimension(331.0, 433.0)));
selection.stopDragging(-10.0, -10.0);
assertFalse(selection.isDragging());
}