@Test
public void shouldNotTriggerDragEnteredWithNoPlaylist() {
ListCell<Playlist> listCell = cellFactory.call(getListView());
listCell.setItem(null);
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, new Object()));
listCell.onDragEnteredProperty().get().handle(spyDragEvent);
assertThat("List cell style should be empty", listCell.getStyle(), isEmptyString());
verify(spyDragEvent, times(1)).consume();
}
PlaylistListCellFactoryTest.java 文件源码
java
阅读 39
收藏 0
点赞 0
评论 0
项目:rpmjukebox
作者:
评论列表
文章目录