@Test public void testOnDragAreaMouseMove() { final HTMLElement dragging = mock(HTMLElement.class); final HTMLElement oldElement = mock(HTMLElement.class); final MouseEvent event = mock(MouseEvent.class); final int newPosition = 2; final int oldPosition = 1; final int delta = 444; doReturn(dragging).when(helper).getDragging(); doReturn(delta).when(helper).getDelta(event); doReturn(newPosition).when(helper).getNewPosition(); doReturn(oldPosition).when(helper).position(dragging); doReturn(oldElement).when(helper).findElementByPosition(newPosition); doNothing().when(helper).swapElements(oldElement, dragging); doNothing().when(helper).setTop(dragging, delta); helper.onDragAreaMouseMove(event); verify(helper).swapElements(oldElement, dragging); verify(helper).setTop(dragging, delta); }
Object onDragAreaMouseMove(final Event e) { if (Objects.isNull(getDragging())) { return this; } final MouseEvent event = (MouseEvent) e; final int delta = getDelta(event); final int newPosition = getNewPosition(); final int oldPosition = position(getDragging()); if (newPosition != oldPosition) { swapElements(findElementByPosition(newPosition), getDragging()); } setTop(getDragging(), startYPosition + delta); return this; }
DragAndDropHelper { Object onDragAreaMouseMove(final Event e) { if (Objects.isNull(getDragging())) { return this; } final MouseEvent event = (MouseEvent) e; final int delta = getDelta(event); final int newPosition = getNewPosition(); final int oldPosition = position(getDragging()); if (newPosition != oldPosition) { swapElements(findElementByPosition(newPosition), getDragging()); } setTop(getDragging(), startYPosition + delta); return this; } }
DragAndDropHelper { Object onDragAreaMouseMove(final Event e) { if (Objects.isNull(getDragging())) { return this; } final MouseEvent event = (MouseEvent) e; final int delta = getDelta(event); final int newPosition = getNewPosition(); final int oldPosition = position(getDragging()); if (newPosition != oldPosition) { swapElements(findElementByPosition(newPosition), getDragging()); } setTop(getDragging(), startYPosition + delta); return this; } DragAndDropHelper(final HTMLElement dragArea,
                             final HTMLElement addButtonContainer); }
DragAndDropHelper { Object onDragAreaMouseMove(final Event e) { if (Objects.isNull(getDragging())) { return this; } final MouseEvent event = (MouseEvent) e; final int delta = getDelta(event); final int newPosition = getNewPosition(); final int oldPosition = position(getDragging()); if (newPosition != oldPosition) { swapElements(findElementByPosition(newPosition), getDragging()); } setTop(getDragging(), startYPosition + delta); return this; } DragAndDropHelper(final HTMLElement dragArea,
                             final HTMLElement addButtonContainer);  }
DragAndDropHelper { Object onDragAreaMouseMove(final Event e) { if (Objects.isNull(getDragging())) { return this; } final MouseEvent event = (MouseEvent) e; final int delta = getDelta(event); final int newPosition = getNewPosition(); final int oldPosition = position(getDragging()); if (newPosition != oldPosition) { swapElements(findElementByPosition(newPosition), getDragging()); } setTop(getDragging(), startYPosition + delta); return this; } DragAndDropHelper(final HTMLElement dragArea,
                             final HTMLElement addButtonContainer);   }