@Test public void testGoToDetails() { when(wordPressService.listPosts(eq(1))) .thenReturn(postResponse(1)); PostListModel model = viewModel.initAndResume(); Post firstPost = model.getItems().get(0); viewModel.goToDetail(0); verify(navigator).openDetail(captor.capture()); Post detailPost = captor.getValue(); String url = detailPost.url(); assertThat(url).isNotNull(); assertThat(url).isEqualTo(firstPost.url()); }
public void goToDetail(int position) { Post item = model.getItems().get(position); navigator.openDetail(item); }
PostListViewModel extends RxListViewModel<PostListArgument, PostListModel> { public void goToDetail(int position) { Post item = model.getItems().get(position); navigator.openDetail(item); } }
PostListViewModel extends RxListViewModel<PostListArgument, PostListModel> { public void goToDetail(int position) { Post item = model.getItems().get(position); navigator.openDetail(item); } @Inject  PostListViewModel(); }
PostListViewModel extends RxListViewModel<PostListArgument, PostListModel> { public void goToDetail(int position) { Post item = model.getItems().get(position); navigator.openDetail(item); } @Inject  PostListViewModel(); void goToDetail(int position); void loadNextPage(); boolean isToolbarVisible(); String getToolbarTitle(); }
PostListViewModel extends RxListViewModel<PostListArgument, PostListModel> { public void goToDetail(int position) { Post item = model.getItems().get(position); navigator.openDetail(item); } @Inject  PostListViewModel(); void goToDetail(int position); void loadNextPage(); boolean isToolbarVisible(); String getToolbarTitle();  }