Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
@Inject
private UsersPresenter presenter;
@Inject
private UsersPresenter.MyView view;
@Inject
private ResourceDelegate<UserApi> userApiResourceDelegate;
@Inject
private UserApi userApi;
private List<User> users = new ArrayList<>();
@Before
public void setUp() {
givenDelegate(userApiResourceDelegate).useResource(userApi);
}
@Test
public void prepareFromRequest_displaysUsers_onSuccess() {
PlaceRequest placeRequest = new PlaceRequest();
givenDelegate(userApiResourceDelegate)
.succeed().withResult(users)
.when().getUsers();
presenter.prepareFromRequest(placeRequest);
verify(view).displayUsers(same(users));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment