package URLShortener.Test;

import URLShortener.Utility.JsonValues;
import URLShortener.Utility.ShortURLData;
import URLShortener.Utility.URLShortener;
import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Created by Vincenzo_Pc on 20/08/2015.
 */
public class ShortURLDataTest {

    int i=0;
    int j=0;
    String[] cases = {"broJG","SQhAJ","GHoHp","q8xTB","vlynY","IRosu","NuUr8","cxmDH"};
    String[] cases1 = {"www.google.it","www.amazon.com","www.basididatiavanzati.de","https://www.focus.it","www.ciaosic.sl","www.happycasa.org","www.ultimoesameesto.ciao","www.tempesta.civediamo"};

<<<<<<< HEAD

=======
<<<<<<< HEAD
    String cases = "broJG";
    String cases1 = "www.google.it";
    ShortURLData test = new ShortURLData(cases,cases1);


=======
>>>>>>> origin/master
    ShortURLData test = new ShortURLData(cases[i],cases1[j]);
>>>>>>> origin/master
    @Test
    public void testSetJsonString() throws Exception {
        JsonValues result = test.setJsonString();
        assertTrue(result != null);

    }

    @Test
    public void testAddNewClick() throws Exception {

    }

    @Test
    public void testSaveShortLongURL() throws Exception {
        for(i=0;i<cases.length;i++){
            for(j=0;j<cases1.length;j++){

                boolean result = test.saveShortLongURL(cases[i], cases1[j]);
                assertTrue(result==false);
            }
        }

    }


}

@@ -328,18 +328,22 @@
 ng%5B%5D cas
-es
+oPrimo
  = %7B%22bro
@@ -420,19 +420,24 @@
 ng%5B%5D cas
-es1
+oSecondo
  = %7B%22www
@@ -612,279 +612,79 @@
 %7D;%0A%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A%0A=======%0A%3C%3C%3C%3C%3C%3C%3C HEAD%0A    String cases = %22broJG%22;%0A    String cases1 = %22www.google.it%22;%0A    ShortURLData test = new ShortURLData(cases,cases1);%0A%0A%0A=======%0A%3E%3E%3E%3E%3E%3E%3E origin/master%0A    ShortURLData test = new ShortURLData(cases%5Bi%5D,cases1%5Bj%5D);%0A%3E%3E%3E%3E%3E%3E%3E origin/master
+    ShortURLData test = new ShortURLData(casoPrimo%5Bi%5D,casoSecondo%5Bj%5D);%0A
 %0A   
@@ -999,18 +999,22 @@
 =0;i%3Ccas
-es
+oPrimo
 .length;
@@ -1044,19 +1044,24 @@
 =0;j%3Ccas
-es1
+oSecondo
 .length;
@@ -1129,18 +1129,22 @@
 (cas
-es
+oPrimo
 %5Bi%5D, cas
 es1%5B
@@ -1143,11 +1143,16 @@
  cas
-es1
+oSecondo
 %5Bj%5D)

Update Test