Skip to content

Instantly share code, notes, and snippets.

@miquelbeltran
Last active September 5, 2016 17:52
Show Gist options
  • Save miquelbeltran/ce4f3d062cee48223ab3640ffe268d25 to your computer and use it in GitHub Desktop.
Save miquelbeltran/ce4f3d062cee48223ab3640ffe268d25 to your computer and use it in GitHub Desktop.
public void ProfilePresenterTest {
@Mock
ProfileInteractor interactor;
@Mock
ProfileView view;
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
when(interactor.getUserProfile()).thenReturn(Observable.just(new UserProfile()));
presenter = new ProfilePresenter(interactor);
presenter.attachView(view);
}
@Test
public void testDisplayCalled() {
verify(interactor).getUserProfile();
verify(view).display(any());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment