UserFeedsRepository { public List<Feed> getFeeds() { return httpClient.getApi().getUserFeeds(); } @Inject  UserFeedsRepository(HttpClient httpClient); List<Feed> getFeeds(); Feed getFeed(String id);  }
@Test public void itReturnsFeedIdWhenGetFeeds() { Feed feed = repository.getFeeds().get(firstPosition); Feed expectedFeed = new Feed() { @Override public String getId() { return "123456"; } }; assertThat(feed.getId(), is(expectedFeed.getId())); }
@Test public void itReturnsFeedTitleWhenGetFeeds() { Feed feed = repository.getFeeds().get(firstPosition); Feed expectedFeed = new Feed() { @Override public String getTitle() { return "Some podcast"; } }; assertThat(feed.getTitle(), is(expectedFeed.getTitle())); }
@Test public void itReturnsFeedImageUrlWhenGetFeeds() { Feed feed = repository.getFeeds().get(firstPosition); Feed expectedFeed = new Feed() { @Override public Image getImage() { return new Image() { @Override public String getUrl() { return "http: } }; } }; assertThat(feed.getImage().getUrl(), is(expectedFeed.getImage().getUrl())); }