// Path: androidsdk/src/test/java/com/wootric/androidsdk/TestHelper.java
// public class TestHelper {
//     private static final String CLIENT_ID = "testClientId";
//     private static final String CLIENT_SECRET = "testClientSecret";
//     private static final String ACCOUNT_TOKEN = "testAccountToken";
//     public static final String ORIGIN_URL = "com.test.app";
// 
//     public static User testUser() {
//         return new User(CLIENT_ID, CLIENT_SECRET, ACCOUNT_TOKEN);
//     }
// 
//     public static EndUser testEndUser() {
//         return new EndUser();
//     }
// 
//     public static PreferencesUtils testPreferenceUtils() {
//         WeakReference weakContext = new WeakReference<>(TEST_FRAGMENT_ACTIVITY.getApplicationContext());
//         return new PreferencesUtils(weakContext);
//     }
// 
//     public static final FragmentActivity TEST_FRAGMENT_ACTIVITY = new FragmentActivity() {
//         @Override
//         public PackageManager getPackageManager() {
//             return getPackageManager();
//         }
// 
//         @Override
//         public ApplicationInfo getApplicationInfo() {
//             return TEST_APPLICATION_INFO;
//         }
// 
//         @Override
//         public Context getApplicationContext() {
//             return null;
//         }
//     };
// 
//     private static final ApplicationInfo TEST_APPLICATION_INFO = new ApplicationInfo() {
//         public static final String packageName = "";
//     };
// 
//     public String loadJSONFromAsset(String fileName) throws IOException {
//         String json = null;
//         try {
//             String path = "src/test/resources/" + fileName;
//             File file = new File(path);
//             InputStream is = new FileInputStream(file);
//             int size = is.available();
//             byte[] buffer = new byte[size];
//             is.read(buffer);
//             is.close();
//             json = new String(buffer, "UTF-8");
//         } catch (IOException ex) {
//             ex.printStackTrace();
//             return null;
//         }
//         return json;
//     }
// }


import android.os.Parcel;
import com.wootric.androidsdk.TestHelper;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
import java.io.IOException;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
        assertThat(customThankYou.getLinkTextForScore(4, "CSAT", 0)).isEqualTo("promoter");
        assertThat(customThankYou.getLinkTextForScore(5, "CSAT", 0)).isEqualTo("promoter");
    }

    @Test
    public void returnsCSATDefaultLinkText() throws Exception {
        WootricCustomThankYou customThankYou = new WootricCustomThankYou();
        customThankYou.setLinkText("thank you");

        assertThat(customThankYou.getLinkTextForScore(1, "CSAT", 0)).isEqualTo("thank you");
        assertThat(customThankYou.getLinkTextForScore(5, "CSAT", 0)).isEqualTo("thank you");
    }

    @Test
    public void testWootricCustomThankYouParcelable(){
        doReturn("testing parcel").when(mParcel).readString();
        WootricCustomThankYou customThankYou = new WootricCustomThankYou();
        customThankYou.setText("testing parcel");

        Parcel parcel = mParcel;
        customThankYou.writeToParcel(parcel, 0);

        parcel.setDataPosition(0);

        WootricCustomThankYou createdFromParcel = WootricCustomThankYou.CREATOR.createFromParcel(parcel);
        assertThat(createdFromParcel.getTextForScore(10, "NPS", 0)).isEqualTo("testing parcel");
    }

    @Test
    public void testWootricCustomThankYouFromJson() throws IOException, JSONException {
// Path: androidsdk/src/test/java/com/wootric/androidsdk/TestHelper.java
// public class TestHelper {
//     private static final String CLIENT_ID = "testClientId";
//     private static final String CLIENT_SECRET = "testClientSecret";
//     private static final String ACCOUNT_TOKEN = "testAccountToken";
//     public static final String ORIGIN_URL = "com.test.app";
// 
//     public static User testUser() {
//         return new User(CLIENT_ID, CLIENT_SECRET, ACCOUNT_TOKEN);
//     }
// 
//     public static EndUser testEndUser() {
//         return new EndUser();
//     }
// 
//     public static PreferencesUtils testPreferenceUtils() {
//         WeakReference weakContext = new WeakReference<>(TEST_FRAGMENT_ACTIVITY.getApplicationContext());
//         return new PreferencesUtils(weakContext);
//     }
// 
//     public static final FragmentActivity TEST_FRAGMENT_ACTIVITY = new FragmentActivity() {
//         @Override
//         public PackageManager getPackageManager() {
//             return getPackageManager();
//         }
// 
//         @Override
//         public ApplicationInfo getApplicationInfo() {
//             return TEST_APPLICATION_INFO;
//         }
// 
//         @Override
//         public Context getApplicationContext() {
//             return null;
//         }
//     };
// 
//     private static final ApplicationInfo TEST_APPLICATION_INFO = new ApplicationInfo() {
//         public static final String packageName = "";
//     };
// 
//     public String loadJSONFromAsset(String fileName) throws IOException {
//         String json = null;
//         try {
//             String path = "src/test/resources/" + fileName;
//             File file = new File(path);
//             InputStream is = new FileInputStream(file);
//             int size = is.available();
//             byte[] buffer = new byte[size];
//             is.read(buffer);
//             is.close();
//             json = new String(buffer, "UTF-8");
//         } catch (IOException ex) {
//             ex.printStackTrace();
//             return null;
//         }
//         return json;
//     }
// }


// Path: androidsdk/src/test/java/com/wootric/androidsdk/objects/WootricCustomThankYouTest.java
import android.os.Parcel;
import com.wootric.androidsdk.TestHelper;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
import java.io.IOException;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;

        assertThat(customThankYou.getLinkTextForScore(4, "CSAT", 0)).isEqualTo("promoter");
        assertThat(customThankYou.getLinkTextForScore(5, "CSAT", 0)).isEqualTo("promoter");
    }

    @Test
    public void returnsCSATDefaultLinkText() throws Exception {
        WootricCustomThankYou customThankYou = new WootricCustomThankYou();
        customThankYou.setLinkText("thank you");

        assertThat(customThankYou.getLinkTextForScore(1, "CSAT", 0)).isEqualTo("thank you");
        assertThat(customThankYou.getLinkTextForScore(5, "CSAT", 0)).isEqualTo("thank you");
    }

    @Test
    public void testWootricCustomThankYouParcelable(){
        doReturn("testing parcel").when(mParcel).readString();
        WootricCustomThankYou customThankYou = new WootricCustomThankYou();
        customThankYou.setText("testing parcel");

        Parcel parcel = mParcel;
        customThankYou.writeToParcel(parcel, 0);

        parcel.setDataPosition(0);

        WootricCustomThankYou createdFromParcel = WootricCustomThankYou.CREATOR.createFromParcel(parcel);
        assertThat(createdFromParcel.getTextForScore(10, "NPS", 0)).isEqualTo("testing parcel");
    }

    @Test
    public void testWootricCustomThankYouFromJson() throws IOException, JSONException {
        TestHelper helper = new TestHelper();