// 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/player/notification/AudioPlayerNotification.java
// protected static final String FAST_FORWARD = "Fast Forward";
// 
// Path: app/src/main/java/com/mypodcasts/player/notification/AudioPlayerNotification.java
// protected static final String PAUSE = "Pause";
// 
// Path: app/src/main/java/com/mypodcasts/player/notification/AudioPlayerNotification.java
// protected static final String REWIND = "Rewind";
// 
// Path: app/src/main/java/com/mypodcasts/player/notification/AudioPlayerNotification.java
// protected static final String STOP = "Stop";


import android.annotation.TargetApi;
import android.app.Notification;
import android.graphics.drawable.Icon;
import android.os.Build;
import com.mypodcasts.BuildConfig;
import com.mypodcasts.R;
import com.mypodcasts.repositories.models.Episode;
import com.mypodcasts.repositories.models.Feed;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import static com.mypodcasts.player.notification.AudioPlayerNotification.FAST_FORWARD;
import static com.mypodcasts.player.notification.AudioPlayerNotification.PAUSE;
import static com.mypodcasts.player.notification.AudioPlayerNotification.REWIND;
import static com.mypodcasts.player.notification.AudioPlayerNotification.STOP;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.robolectric.RuntimeEnvironment.application;
    Notification notification = audioPlayerNotification.buildNotification(episode);

    assertThat(notification.visibility, is(Notification.VISIBILITY_PUBLIC));
  }

  @Test
  public void itSetsNotificationContentTitle() {
    Notification notification = audioPlayerNotification.buildNotification(episode);

    assertThat(notification.extras.getString(Notification.EXTRA_TITLE), is("Foo Bar"));
  }

  @Test
  public void itSetsNotificationContentText() {
    Notification notification = audioPlayerNotification.buildNotification(episode);

    assertThat(notification.extras.getString(Notification.EXTRA_TEXT), is("Lorem ipsum dolor sit amet"));
  }

  @TargetApi(Build.VERSION_CODES.M)
  @Test
  public void itReturnsNotificationWithMediaControlActions() {
    Notification notification = audioPlayerNotification.buildNotification(episode);

    assertThat(String.valueOf(notification.actions[0].title), is(REWIND));
    assertThat(
        notification.actions[0].getIcon().toString(),
        is(Icon.createWithResource("", R.drawable.ic_fast_rewind).toString())
    );

// 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/player/notification/AudioPlayerNotification.java
// protected static final String FAST_FORWARD = "Fast Forward";
// 
// Path: app/src/main/java/com/mypodcasts/player/notification/AudioPlayerNotification.java
// protected static final String PAUSE = "Pause";
// 
// Path: app/src/main/java/com/mypodcasts/player/notification/AudioPlayerNotification.java
// protected static final String REWIND = "Rewind";
// 
// Path: app/src/main/java/com/mypodcasts/player/notification/AudioPlayerNotification.java
// protected static final String STOP = "Stop";


// Path: app/src/test/java/com/mypodcasts/player/notification/AudioPlayerNotificationTest.java
import android.annotation.TargetApi;
import android.app.Notification;
import android.graphics.drawable.Icon;
import android.os.Build;
import com.mypodcasts.BuildConfig;
import com.mypodcasts.R;
import com.mypodcasts.repositories.models.Episode;
import com.mypodcasts.repositories.models.Feed;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import static com.mypodcasts.player.notification.AudioPlayerNotification.FAST_FORWARD;
import static com.mypodcasts.player.notification.AudioPlayerNotification.PAUSE;
import static com.mypodcasts.player.notification.AudioPlayerNotification.REWIND;
import static com.mypodcasts.player.notification.AudioPlayerNotification.STOP;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.robolectric.RuntimeEnvironment.application;

    Notification notification = audioPlayerNotification.buildNotification(episode);

    assertThat(notification.visibility, is(Notification.VISIBILITY_PUBLIC));
  }

  @Test
  public void itSetsNotificationContentTitle() {
    Notification notification = audioPlayerNotification.buildNotification(episode);

    assertThat(notification.extras.getString(Notification.EXTRA_TITLE), is("Foo Bar"));
  }

  @Test
  public void itSetsNotificationContentText() {
    Notification notification = audioPlayerNotification.buildNotification(episode);

    assertThat(notification.extras.getString(Notification.EXTRA_TEXT), is("Lorem ipsum dolor sit amet"));
  }

  @TargetApi(Build.VERSION_CODES.M)
  @Test
  public void itReturnsNotificationWithMediaControlActions() {
    Notification notification = audioPlayerNotification.buildNotification(episode);

    assertThat(String.valueOf(notification.actions[0].title), is(REWIND));
    assertThat(
        notification.actions[0].getIcon().toString(),
        is(Icon.createWithResource("", R.drawable.ic_fast_rewind).toString())
    );

    assertThat(String.valueOf(notification.actions[1].title), is(PAUSE));