@Test
public void shouldNotTriggerDragEnterdWithSameSource() {
ListCell<Playlist> listCell = cellFactory.call(getListView());
listCell.setItem(new Playlist(1, "Playlist", 10));
listCell.setStyle(null);
Dragboard mockDragboard = mock(Dragboard.class);
when(mockDragboard.hasContent(DND_TRACK_DATA_FORMAT)).thenReturn(true);
DragEvent spyDragEvent = spy(getDragEvent(DragEvent.DRAG_OVER, mockDragboard, TransferMode.COPY, listCell));
listCell.onDragEnteredProperty().get().handle(spyDragEvent);
assertThat("List cell style should be empty", listCell.getStyle(), isEmptyString());
verify(spyDragEvent, times(1)).consume();
}
PlaylistListCellFactoryTest.java 文件源码
java
阅读 88
收藏 0
点赞 0
评论 0
项目:rpmjukebox
作者:
评论列表
文章目录