Skip to content

Instantly share code, notes, and snippets.

@fge
Created January 11, 2015 14:58
Show Gist options
  • Save fge/552fe4b1f0f959620e82 to your computer and use it in GitHub Desktop.
Save fge/552fe4b1f0f959620e82 to your computer and use it in GitHub Desktop.
public void loadFileOKTest()
throws IOException
{
final File file = mock(File.class);
final String content = "file contents";
doReturn(file).when(presenter).getInputFile();
doReturn(content).when(presenter).getContents(file);
final InOrder inOrder = inOrder(presenter, view);
ui.loadInput(mock(ActionEvent.class));
inOrder.verify(presenter).getInputFile();
inOrder.verify(presenter).getContents(file);
inOrder.verify(view).setInputText(content);
inOrder.verifyNoMoreInteractions();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment