// 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";
//     }
//   }
// }


import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.android.volley.toolbox.ImageLoader;
import com.mypodcasts.BuildConfig;
import com.mypodcasts.R;
import com.mypodcasts.repositories.models.Episode;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.util.List;
import static java.lang.String.valueOf;
import static java.util.Arrays.asList;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.robolectric.Robolectric.buildActivity;
package com.mypodcasts.episodes;






@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class)
public class EpisodeListAdapterTest {

  Activity activity;
  ViewGroup parent;

  EpisodeViewInflater episodeViewInflater;

  int firstPosition = 0;

  @Before
  public void setup() {
    activity = buildActivity(Activity.class).create().get();

    episodeViewInflater = new EpisodeViewInflater(
        activity, mock(ImageLoader.class), mock(EpisodeDownloader.class)
    );

    parent = new ViewGroup(activity) {
      @Override
      protected void onLayout(boolean changed, int l, int t, int r, int b) {
      }
    };
  }

  @Test
  public void itReturnsEpisodesCount() {
// 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/test/java/com/mypodcasts/episodes/EpisodeListAdapterTest.java
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.android.volley.toolbox.ImageLoader;
import com.mypodcasts.BuildConfig;
import com.mypodcasts.R;
import com.mypodcasts.repositories.models.Episode;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.util.List;
import static java.lang.String.valueOf;
import static java.util.Arrays.asList;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.robolectric.Robolectric.buildActivity;

package com.mypodcasts.episodes;






@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class)
public class EpisodeListAdapterTest {

  Activity activity;
  ViewGroup parent;

  EpisodeViewInflater episodeViewInflater;

  int firstPosition = 0;

  @Before
  public void setup() {
    activity = buildActivity(Activity.class).create().get();

    episodeViewInflater = new EpisodeViewInflater(
        activity, mock(ImageLoader.class), mock(EpisodeDownloader.class)
    );

    parent = new ViewGroup(activity) {
      @Override
      protected void onLayout(boolean changed, int l, int t, int r, int b) {
      }
    };
  }

  @Test
  public void itReturnsEpisodesCount() {
    List<Episode> episodes = asList(new Episode());