package co.ello.ElloApp;

import android.os.Build;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;

import ello.co.ello.BuildConfig;

import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;

@Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.LOLLIPOP)
@RunWith(RobolectricGradleTestRunner.class)
public class ElloURITest {

    // leaving this in for future reference even though it is empty
    @Before
    public void setup() {
    }

    @Test
    public void testShouldLoadInAppSucceeds() {
        assertTrue("https://co.ello.ello.co should load in app", ElloURI.shouldLoadInApp("https://co.ello.ello.co"));
        assertTrue("https://co.ello.ello-webapp-epic.herokuapp.com should load in app", ElloURI.shouldLoadInApp("https://co.ello.ello-webapp-epic.herokuapp.com"));
        assertTrue("https://co.ello.ello-webapp-rainbow.herokuapp.com should load in app", ElloURI.shouldLoadInApp("https://co.ello.ello-webapp-rainbow.herokuapp.com"));
        assertTrue("https://co.ello.ello.co/sean should load in app", ElloURI.shouldLoadInApp("https://co.ello.ello.co/sean"));
        assertTrue("https://preview.co.ello.ello.co should load in app", ElloURI.shouldLoadInApp("https://preview.co.ello.ello.co"));
        assertTrue("/sean should load in app", ElloURI.shouldLoadInApp("/sean"));
    }

    @Test
    public void testShouldLoadInAppFails() {
        assertFalse("https://hello.co should NOT load in app", ElloURI.shouldLoadInApp("https://hello.co"));
        assertFalse("https://www.google.com should NOT load in app", ElloURI.shouldLoadInApp("https://www.google.com"));
        assertFalse("yo/sean should NOT load in app", ElloURI.shouldLoadInApp("yo/sean"));
    }
}

@@ -697,32 +697,24 @@
 ue(%22https://
-co.ello.
 ello.co shou
@@ -759,32 +759,24 @@
 pp(%22https://
-co.ello.
 ello.co%22));%0A
@@ -799,32 +799,24 @@
 ue(%22https://
-co.ello.
 ello-webapp-
@@ -884,32 +884,24 @@
 pp(%22https://
-co.ello.
 ello-webapp-
@@ -947,32 +947,24 @@
 ue(%22https://
-co.ello.
 ello-webapp-
@@ -1035,32 +1035,24 @@
 pp(%22https://
-co.ello.
 ello-webapp-
@@ -1101,32 +1101,24 @@
 ue(%22https://
-co.ello.
 ello.co/sean
@@ -1172,24 +1172,16 @@
 https://
-co.ello.
 ello.co/
@@ -1221,32 +1221,24 @@
 s://preview.
-co.ello.
 ello.co shou
@@ -1295,24 +1295,16 @@
 preview.
-co.ello.
 ello.co%22

fix tests