// Path: app/src/main/java/com/mypodcasts/repositories/models/Episode.java
// public class Episode implements Serializable {
// 
//   private String title;
//   private String publishedDate;
//   private String description;
//   private String duration;
//   private Audio audio;
//   private Feed podcast;
//   private Image image;
// 
//   public Image getImage() {
//     return image;
//   }
// 
//   public String getTitle() {
//     return title;
//   }
// 
//   public Date getPublishedDate() {
//     if (publishedDate == null) { return null; }
// 
//     return dateTimeParser().parseDateTime(publishedDate).toDate();
//   }
// 
//   public String getDescription() {
//     return description == null ? "" : description;
//   }
// 
//   public String getDuration() {
//     return duration;
//   }
// 
//   public Feed getFeed() {
//     if (podcast == null) { return new Feed(); }
// 
//     return podcast;
//   }
// 
//   public String getAudioFilePath() {
//     return getFeed().getId() + "/" + getTitle() + ".mp3";
//   }
// 
//   public String getAudioUrl() {
//     return getAudio().getUrl();
//   }
// 
//   public String getAudioLength() {
//     return getAudio().getLength();
//   }
// 
//   protected Audio getAudio() {
//     if (audio == null) { return new EmptyAudio(); }
// 
//     return audio;
//   }
// 
//   @Override
//   public String toString() {
//     return format(
//         "{ \"title\": %s, " +
//             "\"audioFilePath\": %s, " +
//             "\"feed\": { \"id\": %s, \"title\": %s } " +
//         "}",
//         getTitle(),
//         getAudioFilePath(),
//         getFeed().getId(),
//         getFeed().getTitle()
//     );
//   }
// 
//   private class EmptyAudio extends Audio {
//     @Override
//     public String getUrl() {
//       return "";
//     }
// 
//     @Override
//     public String getLength() {
//       return "0";
//     }
//   }
// }
// 
// Path: app/src/main/java/com/mypodcasts/repositories/models/Feed.java
// public class Feed implements Serializable {
//   private String id;
//   private String title;
//   private Image image;
//   private List<Episode> episodes;
// 
//   public String getId() {
//     return id;
//   }
// 
//   public String getTitle() {
//     return title;
//   }
// 
//   public Image getImage() {
//     return image;
//   }
// 
//   public List<Episode> getEpisodes() {
//     return episodes;
//   }
// 
// }
// 
// Path: app/src/main/java/com/mypodcasts/repositories/models/Image.java
// public class Image implements Serializable {
//   private String url;
// 
//   public String getUrl() {
//     return url;
//   }
// }


import android.content.res.Resources;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import com.mypodcasts.R;
import com.mypodcasts.repositories.models.Episode;
import com.mypodcasts.repositories.models.Feed;
import com.mypodcasts.repositories.models.Image;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.util.Date;
import retrofit.RestAdapter;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.givenThat;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static org.hamcrest.CoreMatchers.is;
import static org.joda.time.format.ISODateTimeFormat.dateTimeParser;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
      public String getTitle() {
        return "Newest Episode!";
      }
    };

    assertThat(episode.getTitle(), is(expectedEpisode.getTitle()));
  }

  @Test
  public void itReturnsAudioUrlWhenGetFeeds() {
    Feed feed = repository.getFeed(expectedId);
    Episode episode = feed.getEpisodes().get(firstPosition);

    Episode expectedEpisode = new Episode() {
      @Override
      public String getAudioUrl() {
        return "http://example.com/newest_episode.mp3";
      }
    };

    assertThat(episode.getAudioUrl(), is(expectedEpisode.getAudioUrl()));
  }

  @Test
  public void itReturnsImageUrlWhenGetFeeds() {
    Feed feed = repository.getFeed(expectedId);
    Episode episode = feed.getEpisodes().get(firstPosition);

    Episode expectedEpisode = new Episode() {
      @Override
// Path: app/src/main/java/com/mypodcasts/repositories/models/Episode.java
// public class Episode implements Serializable {
// 
//   private String title;
//   private String publishedDate;
//   private String description;
//   private String duration;
//   private Audio audio;
//   private Feed podcast;
//   private Image image;
// 
//   public Image getImage() {
//     return image;
//   }
// 
//   public String getTitle() {
//     return title;
//   }
// 
//   public Date getPublishedDate() {
//     if (publishedDate == null) { return null; }
// 
//     return dateTimeParser().parseDateTime(publishedDate).toDate();
//   }
// 
//   public String getDescription() {
//     return description == null ? "" : description;
//   }
// 
//   public String getDuration() {
//     return duration;
//   }
// 
//   public Feed getFeed() {
//     if (podcast == null) { return new Feed(); }
// 
//     return podcast;
//   }
// 
//   public String getAudioFilePath() {
//     return getFeed().getId() + "/" + getTitle() + ".mp3";
//   }
// 
//   public String getAudioUrl() {
//     return getAudio().getUrl();
//   }
// 
//   public String getAudioLength() {
//     return getAudio().getLength();
//   }
// 
//   protected Audio getAudio() {
//     if (audio == null) { return new EmptyAudio(); }
// 
//     return audio;
//   }
// 
//   @Override
//   public String toString() {
//     return format(
//         "{ \"title\": %s, " +
//             "\"audioFilePath\": %s, " +
//             "\"feed\": { \"id\": %s, \"title\": %s } " +
//         "}",
//         getTitle(),
//         getAudioFilePath(),
//         getFeed().getId(),
//         getFeed().getTitle()
//     );
//   }
// 
//   private class EmptyAudio extends Audio {
//     @Override
//     public String getUrl() {
//       return "";
//     }
// 
//     @Override
//     public String getLength() {
//       return "0";
//     }
//   }
// }
// 
// Path: app/src/main/java/com/mypodcasts/repositories/models/Feed.java
// public class Feed implements Serializable {
//   private String id;
//   private String title;
//   private Image image;
//   private List<Episode> episodes;
// 
//   public String getId() {
//     return id;
//   }
// 
//   public String getTitle() {
//     return title;
//   }
// 
//   public Image getImage() {
//     return image;
//   }
// 
//   public List<Episode> getEpisodes() {
//     return episodes;
//   }
// 
// }
// 
// Path: app/src/main/java/com/mypodcasts/repositories/models/Image.java
// public class Image implements Serializable {
//   private String url;
// 
//   public String getUrl() {
//     return url;
//   }
// }


// Path: app/src/test/java/com/mypodcasts/repositories/UserFeedsRepositoryTest.java
import android.content.res.Resources;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import com.mypodcasts.R;
import com.mypodcasts.repositories.models.Episode;
import com.mypodcasts.repositories.models.Feed;
import com.mypodcasts.repositories.models.Image;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.util.Date;
import retrofit.RestAdapter;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.givenThat;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static org.hamcrest.CoreMatchers.is;
import static org.joda.time.format.ISODateTimeFormat.dateTimeParser;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

      public String getTitle() {
        return "Newest Episode!";
      }
    };

    assertThat(episode.getTitle(), is(expectedEpisode.getTitle()));
  }

  @Test
  public void itReturnsAudioUrlWhenGetFeeds() {
    Feed feed = repository.getFeed(expectedId);
    Episode episode = feed.getEpisodes().get(firstPosition);

    Episode expectedEpisode = new Episode() {
      @Override
      public String getAudioUrl() {
        return "http://example.com/newest_episode.mp3";
      }
    };

    assertThat(episode.getAudioUrl(), is(expectedEpisode.getAudioUrl()));
  }

  @Test
  public void itReturnsImageUrlWhenGetFeeds() {
    Feed feed = repository.getFeed(expectedId);
    Episode episode = feed.getEpisodes().get(firstPosition);

    Episode expectedEpisode = new Episode() {
      @Override
      public Image getImage() {