package com.wassim.androidmvpbase.test.common;

import com.google.gson.Gson;
import com.wassim.androidmvpbase.data.model.Movie;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;


/**
 * Factory class that makes instances of data models with random field values.
 * The aim of this class is to help setting up test fixtures.
 */
public class TestDataFactory {

    public static String randomUuid() {
        return UUID.randomUUID().toString();
    }

    public static List<Movie> makeMovies(){

        String jsonMovie = "{\n" +
                "\"id\": 1,\n" +
                "\"title\": \"Dawn of the Planet of the Apes\",\n" +
                "\"image\": \"https://lh3.googleusercontent.com/-zzPZ3rv8IQs/Vq4Krg8TEDI/AAAAAAAAAp8/efWYKQxO_vQ/s800-Ic42/1.jpg\",\n" +
                "\"rating\": 8.3,\n" +
                "\"releaseYear\": 2014,\n" +
                "\"genre\": \"Action\",\n" +
                "\"synopsis\": \"A growing nation of genetically evolved apes led by Caesar is threatened by a band of human survivors of the devastating virus unleashed a decade earlier.\"\n" +
                "}";

        Movie movie = new Gson().fromJson(jsonMovie, Movie.class);
        List<Movie> mMovies = new ArrayList<>();
        mMovies.add(movie);
        return mMovies;
    }


}
@@ -1148,166 +1148,1599 @@
     
-Movie movie = new Gson().fromJson(jsonMovie, Movie.class);%0A        List%3CMovie%3E mMovies = new ArrayList%3C%3E();%0A        mMovies.add(movie);%0A        return mMovies
+String jsonMovie2 = %22%7B%5Cn%22 +%0A                %22%5C%22id%5C%22: 2,%5Cn%22 +%0A                %22%5C%22title%5C%22: %5C%22District 9%5C%22,%5Cn%22 +%0A                %22%5C%22image%5C%22: %5C%22https://lh3.googleusercontent.com/-K8J4efkHoQM/Vq4KsRTG1yI/AAAAAAAAAqU/UesoWr5cSu8/s800-Ic42/2.jpg%5C%22,%5Cn%22 +%0A                %22%5C%22rating%5C%22: 8,%5Cn%22 +%0A                %22%5C%22releaseYear%5C%22: 2009,%5Cn%22 +%0A                %22%5C%22genre%5C%22: %5C%22Sci-Fi%5C%22,%5Cn%22 +%0A                %22%5C%22synopsis%5C%22: %5C%22An extraterrestrial race forced to live in slum-like conditions on Earth suddenly finds a kindred spirit in a government agent who is exposed to their biotechnology.%5C%22%5Cn%22 +%0A                %22%7D%22;%0A%0A%0A        Movie movie = new Gson().fromJson(jsonMovie, Movie.class);%0A        Movie movie2 = new Gson().fromJson(jsonMovie2, Movie.class);%0A        List%3CMovie%3E mMovies = new ArrayList%3C%3E();%0A        mMovies.add(movie);%0A        mMovies.add(movie2);%0A        return mMovies;%0A    %7D%0A%0A    public static Movie makeMovie()%7B%0A%0A        String jsonMovie = %22%7B%5Cn%22 +%0A                %22%5C%22id%5C%22: 1,%5Cn%22 +%0A                %22%5C%22title%5C%22: %5C%22Dawn of the Planet of the Apes%5C%22,%5Cn%22 +%0A                %22%5C%22image%5C%22: %5C%22https://lh3.googleusercontent.com/-zzPZ3rv8IQs/Vq4Krg8TEDI/AAAAAAAAAp8/efWYKQxO_vQ/s800-Ic42/1.jpg%5C%22,%5Cn%22 +%0A                %22%5C%22rating%5C%22: 8.3,%5Cn%22 +%0A                %22%5C%22releaseYear%5C%22: 2014,%5Cn%22 +%0A                %22%5C%22genre%5C%22: %5C%22Action%5C%22,%5Cn%22 +%0A                %22%5C%22synopsis%5C%22: %5C%22A growing nation of genetically evolved apes led by Caesar is threatened by a band of human survivors of the devastating virus unleashed a decade earlier.%5C%22%5Cn%22 +%0A                %22%7D%22;%0A        return new Gson().fromJson(jsonMovie, Movie.class)
 ;%0A  

add method makeMovie returns one fake movie