EpisodeListAdapter extends BaseAdapter { @Override public View getView(int position, View recycledView, ViewGroup parent) { final Episode episode = getItem(position); return episodeViewInflater.inflate(recycledView).with(episode).from(parent); } EpisodeListAdapter(List<Episode> episodes, EpisodeViewInflater episodeViewInflater); @Override int getCount(); @Override Episode getItem(int position); @Override long getItemId(int position); @Override View getView(int position, View recycledView, ViewGroup parent);  }
@Test public void itInflatesEpisode() { Episode episode = new Episode() { @Override public String getTitle() { return "Awesome episode"; } }; List<Episode> episodes = asList(episode); EpisodeListAdapter episodeListAdapter = new EpisodeListAdapter(episodes, episodeViewInflater); View view = episodeListAdapter.getView(firstPosition, null, parent); assertNotNull(view); TextView episodeTitle = (TextView) view.findViewById(R.id.episode_title); assertThat(valueOf(episodeTitle.getText()), is(episode.getTitle())); }