// Path: app/src/main/java/com/nilhcem/devoxxfr/data/app/model/Session.java
// @Value
// public class Session implements Parcelable {
// 
//     public static final Parcelable.Creator<Session> CREATOR = new Parcelable.Creator<Session>() {
//         public Session createFromParcel(Parcel source) {
//             return new Session(source);
//         }
// 
//         public Session[] newArray(int size) {
//             return new Session[size];
//         }
//     };
// 
//     int id;
//     String room;
//     List<Speaker> speakers;
//     String title;
//     String description;
//     LocalDateTime fromTime;
//     LocalDateTime toTime;
// 
//     public Session(int id, String room, List<Speaker> speakers, String title, String description, LocalDateTime fromTime, LocalDateTime toTime) {
//         this.id = id;
//         this.room = room;
//         this.speakers = speakers;
//         this.title = title;
//         this.description = description;
//         this.fromTime = fromTime;
//         this.toTime = toTime;
//     }
// 
//     protected Session(Parcel in) {
//         id = in.readInt();
//         room = in.readString();
//         speakers = in.createTypedArrayList(Speaker.CREATOR);
//         title = in.readString();
//         description = in.readString();
//         fromTime = (LocalDateTime) in.readSerializable();
//         toTime = (LocalDateTime) in.readSerializable();
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(id);
//         dest.writeString(room);
//         dest.writeTypedList(speakers);
//         dest.writeString(title);
//         dest.writeString(description);
//         dest.writeSerializable(fromTime);
//         dest.writeSerializable(toTime);
//     }
// }
// 
// Path: app/src/main/java/com/nilhcem/devoxxfr/data/app/model/Speaker.java
// @Value
// public class Speaker implements Parcelable {
// 
//     public static final Parcelable.Creator<Speaker> CREATOR = new Parcelable.Creator<Speaker>() {
//         public Speaker createFromParcel(Parcel source) {
//             return new Speaker(source);
//         }
// 
//         public Speaker[] newArray(int size) {
//             return new Speaker[size];
//         }
//     };
// 
//     int id;
//     String name;
//     String title;
//     String bio;
//     String website;
//     String twitter;
//     String github;
//     String photo;
// 
//     public Speaker(int id, String name, String title, String bio, String website, String twitter, String github, String photo) {
//         this.id = id;
//         this.name = name;
//         this.title = title;
//         this.bio = bio;
//         this.website = website;
//         this.twitter = twitter;
//         this.github = github;
//         this.photo = photo;
//     }
// 
//     protected Speaker(Parcel in) {
//         id = in.readInt();
//         name = in.readString();
//         title = in.readString();
//         bio = in.readString();
//         website = in.readString();
//         twitter = in.readString();
//         github = in.readString();
//         photo = in.readString();
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(id);
//         dest.writeString(name);
//         dest.writeString(title);
//         dest.writeString(bio);
//         dest.writeString(website);
//         dest.writeString(twitter);
//         dest.writeString(github);
//         dest.writeString(photo);
//     }
// }


import com.nilhcem.devoxxfr.BuildConfig;
import com.nilhcem.devoxxfr.data.app.model.Session;
import com.nilhcem.devoxxfr.data.app.model.Speaker;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.TruthJUnit.assume;
        String expected = BuildConfig.VERSION_NAME + " (#" + BuildConfig.VERSION_CODE + ")";

        // When
        String version = App.getVersion();

        // Then
        assertThat(version).isEqualTo(expected);
    }

    @Test
    public void should_return_null_photourl_when_giving_invalid_data() {
        // Given
        Session session1 = null;
        Session session2 = new Session(3, "room1", null, "title", "description", null, null);
        Session session3 = new Session(3, "room1", new ArrayList<>(), "title", "description", null, null);

        // When
        String result1 = App.getPhotoUrl(session1);
        String result2 = App.getPhotoUrl(session2);
        String result3 = App.getPhotoUrl(session3);

        // Then
        assertThat(result1).isNull();
        assertThat(result2).isNull();
        assertThat(result3).isNull();
    }

    @Test
    public void should_return_photo_url_of_first_speaker() {
        // Given
// Path: app/src/main/java/com/nilhcem/devoxxfr/data/app/model/Session.java
// @Value
// public class Session implements Parcelable {
// 
//     public static final Parcelable.Creator<Session> CREATOR = new Parcelable.Creator<Session>() {
//         public Session createFromParcel(Parcel source) {
//             return new Session(source);
//         }
// 
//         public Session[] newArray(int size) {
//             return new Session[size];
//         }
//     };
// 
//     int id;
//     String room;
//     List<Speaker> speakers;
//     String title;
//     String description;
//     LocalDateTime fromTime;
//     LocalDateTime toTime;
// 
//     public Session(int id, String room, List<Speaker> speakers, String title, String description, LocalDateTime fromTime, LocalDateTime toTime) {
//         this.id = id;
//         this.room = room;
//         this.speakers = speakers;
//         this.title = title;
//         this.description = description;
//         this.fromTime = fromTime;
//         this.toTime = toTime;
//     }
// 
//     protected Session(Parcel in) {
//         id = in.readInt();
//         room = in.readString();
//         speakers = in.createTypedArrayList(Speaker.CREATOR);
//         title = in.readString();
//         description = in.readString();
//         fromTime = (LocalDateTime) in.readSerializable();
//         toTime = (LocalDateTime) in.readSerializable();
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(id);
//         dest.writeString(room);
//         dest.writeTypedList(speakers);
//         dest.writeString(title);
//         dest.writeString(description);
//         dest.writeSerializable(fromTime);
//         dest.writeSerializable(toTime);
//     }
// }
// 
// Path: app/src/main/java/com/nilhcem/devoxxfr/data/app/model/Speaker.java
// @Value
// public class Speaker implements Parcelable {
// 
//     public static final Parcelable.Creator<Speaker> CREATOR = new Parcelable.Creator<Speaker>() {
//         public Speaker createFromParcel(Parcel source) {
//             return new Speaker(source);
//         }
// 
//         public Speaker[] newArray(int size) {
//             return new Speaker[size];
//         }
//     };
// 
//     int id;
//     String name;
//     String title;
//     String bio;
//     String website;
//     String twitter;
//     String github;
//     String photo;
// 
//     public Speaker(int id, String name, String title, String bio, String website, String twitter, String github, String photo) {
//         this.id = id;
//         this.name = name;
//         this.title = title;
//         this.bio = bio;
//         this.website = website;
//         this.twitter = twitter;
//         this.github = github;
//         this.photo = photo;
//     }
// 
//     protected Speaker(Parcel in) {
//         id = in.readInt();
//         name = in.readString();
//         title = in.readString();
//         bio = in.readString();
//         website = in.readString();
//         twitter = in.readString();
//         github = in.readString();
//         photo = in.readString();
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(id);
//         dest.writeString(name);
//         dest.writeString(title);
//         dest.writeString(bio);
//         dest.writeString(website);
//         dest.writeString(twitter);
//         dest.writeString(github);
//         dest.writeString(photo);
//     }
// }


// Path: app/src/test/java/com/nilhcem/devoxxfr/utils/AppTest.java
import com.nilhcem.devoxxfr.BuildConfig;
import com.nilhcem.devoxxfr.data.app.model.Session;
import com.nilhcem.devoxxfr.data.app.model.Speaker;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.TruthJUnit.assume;

        String expected = BuildConfig.VERSION_NAME + " (#" + BuildConfig.VERSION_CODE + ")";

        // When
        String version = App.getVersion();

        // Then
        assertThat(version).isEqualTo(expected);
    }

    @Test
    public void should_return_null_photourl_when_giving_invalid_data() {
        // Given
        Session session1 = null;
        Session session2 = new Session(3, "room1", null, "title", "description", null, null);
        Session session3 = new Session(3, "room1", new ArrayList<>(), "title", "description", null, null);

        // When
        String result1 = App.getPhotoUrl(session1);
        String result2 = App.getPhotoUrl(session2);
        String result3 = App.getPhotoUrl(session3);

        // Then
        assertThat(result1).isNull();
        assertThat(result2).isNull();
        assertThat(result3).isNull();
    }

    @Test
    public void should_return_photo_url_of_first_speaker() {
        // Given
        Speaker speaker1 = new Speaker(1, null, null, null, null, null, null, "photo1");