Search in sources :

Example 1 with ComicSeriesDetailViewModel

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);
}
Also used : ComicSeries(com.karumi.rosie.sample.comics.domain.model.ComicSeries) ComicSeriesDetailViewModel(com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailViewModel) InjectedInstrumentationTest(com.karumi.rosie.sample.InjectedInstrumentationTest) Test(org.junit.Test)

Example 2 with ComicSeriesDetailViewModel

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;
}
Also used : ComicSeriesDetailsViewModel(com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailsViewModel) ComicSeriesDetailViewModel(com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailViewModel) LinkedList(java.util.LinkedList)

Aggregations

ComicSeriesDetailViewModel (com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailViewModel)2 InjectedInstrumentationTest (com.karumi.rosie.sample.InjectedInstrumentationTest)1 ComicSeries (com.karumi.rosie.sample.comics.domain.model.ComicSeries)1 ComicSeriesDetailsViewModel (com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailsViewModel)1 LinkedList (java.util.LinkedList)1 Test (org.junit.Test)1