use of com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailViewModel in project Rosie by Karumi.
the class ComicSeriesDetailsActivityTest method shouldShowComicIfComicSeriesHaveComics.
@Test
public void shouldShowComicIfComicSeriesHaveComics() throws Exception {
ComicSeries comicSeries = givenValidComicSeries();
List<ComicSeriesDetailViewModel> comics = givenComicData(comicSeries);
startActivity();
onView(withId(R.id.rv_comics)).perform(RecyclerViewActions.scrollToPosition(1));
assertRecyclerViewShowComics(comics);
}
use of com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailViewModel in project Rosie by Karumi.
the class ComicSeriesToComicSeriesDetailsViewModelMapper method map.
@Override
public ComicSeriesDetailsViewModel map(ComicSeries comicSeries) {
ComicSeriesDetailsViewModel comicSeriesDetailsViewModel = new ComicSeriesDetailsViewModel();
comicSeriesDetailsViewModel.setTitle(comicSeries.getName());
List<ComicSeriesDetailViewModel> comicSeriesDetailViewModels = new LinkedList<>();
comicSeriesDetailViewModels.add(mapComicSeriesToComicSeriesHeaderDetailViewModel(comicSeries));
comicSeriesDetailViewModels.addAll(mapComicsToComicViewModels(comicSeries.getComics()));
comicSeriesDetailsViewModel.setComicSeriesDetailViewModels(comicSeriesDetailViewModels);
return comicSeriesDetailsViewModel;
}
Aggregations