use of com.mxt.anitrend.model.entity.anilist.ExternalLink in project anitrend-app by AniTrend.
the class EpisodeUtilTests method episodeSupport_givenCrunchyrollAndFeedUrl_shouldReturnEither.
@Test
public void episodeSupport_givenCrunchyrollAndFeedUrl_shouldReturnEither() {
String show = "my-hero-academia";
String crunchyUrl = BuildConfig.CRUNCHY_LINK + show;
String feedUrl = BuildConfig.FEEDS_LINK + show + ".rss";
ExternalLink link1 = mock(ExternalLink.class);
ExternalLink link2 = mock(ExternalLink.class);
when(link1.getUrl()).thenReturn(crunchyUrl);
when(link2.getUrl()).thenReturn(feedUrl);
List<ExternalLink> links = Arrays.asList(link1, link2);
assertThat(EpisodeUtil.INSTANCE.episodeSupport(links), is(anyOf(equalTo(show + ".rss"), equalTo(feedUrl))));
}
use of com.mxt.anitrend.model.entity.anilist.ExternalLink in project anitrend-app by AniTrend.
the class AiringPageAdapter method getItem.
/**
* Return the Fragment associated with a specified position.
*
* @param position
*/
@Override
public Fragment getItem(int position) {
switch(position) {
case 0:
return AiringListFragment.newInstance();
case 1:
List<ExternalLink> externalLinks = new ArrayList<>(1);
externalLinks.add(new ExternalLink(BuildConfig.FEEDS_LINK, null));
return WatchListFragment.newInstance(externalLinks, false);
}
return null;
}
Aggregations