@Test
public void shouldCallPlayOrStopEntryOnPlayButtonClick() {
// given
String file = "test.mp3";
Entry entry = mock(Entry.class);
when(entry.getEntrySound()).thenReturn(file);
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) {
clickHandler = (ClickHandler) invocation.getArguments()[0];
return null;
}
}).when(explanationView).addEntryPlayButtonHandler(any(ClickHandler.class));
// when
testObj.init();
testObj.processEntry(entry);
clickHandler.onClick(null);
// then
verify(entryDescriptionSoundController).playOrStopEntrySound(entry.getEntrySound());
}
ExplanationControllerTest.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:empiria.player
作者:
评论列表
文章目录