@Test public void testGetTop() { final HTMLElement element = mock(HTMLElement.class); final CSSStyleDeclaration style = mock(CSSStyleDeclaration.class); final int expected = 123; element.style = style; when(style.getPropertyValue(TOP)).thenReturn("123" + PX); final int actual = helper.getTop(element); assertEquals(expected, actual); }
int getTop(final HTMLElement element) { final String topString = element.style.getPropertyValue(TOP) .replace(PX, ""); if (StringUtils.isEmpty(topString)) { return 0; } return Integer.valueOf(topString); }
DragAndDropHelper { int getTop(final HTMLElement element) { final String topString = element.style.getPropertyValue(TOP) .replace(PX, ""); if (StringUtils.isEmpty(topString)) { return 0; } return Integer.valueOf(topString); } }
DragAndDropHelper { int getTop(final HTMLElement element) { final String topString = element.style.getPropertyValue(TOP) .replace(PX, ""); if (StringUtils.isEmpty(topString)) { return 0; } return Integer.valueOf(topString); } DragAndDropHelper(final HTMLElement dragArea,
                             final HTMLElement addButtonContainer); }
DragAndDropHelper { int getTop(final HTMLElement element) { final String topString = element.style.getPropertyValue(TOP) .replace(PX, ""); if (StringUtils.isEmpty(topString)) { return 0; } return Integer.valueOf(topString); } DragAndDropHelper(final HTMLElement dragArea,
                             final HTMLElement addButtonContainer);  }
DragAndDropHelper { int getTop(final HTMLElement element) { final String topString = element.style.getPropertyValue(TOP) .replace(PX, ""); if (StringUtils.isEmpty(topString)) { return 0; } return Integer.valueOf(topString); } DragAndDropHelper(final HTMLElement dragArea,
                             final HTMLElement addButtonContainer);   }