0
This commit is contained in:
2015-12-02 01:23:17 +00:00
parent 36144aa3d8
commit 70bfaf32a1
10 changed files with 76 additions and 13 deletions

View File

@@ -12,17 +12,28 @@ import static org.junit.Assert.assertTrue;
public class TestHdrezka {
@Test
public void test() {
public void testNormal() {
search(false);
}
@Test
public void testStrong() {
search(true);
}
private void search(boolean strong) {
KinoWarez kinoWarez = new Hdrezka();
List<Kino> kinoList = new ArrayList<>();
String titleKino = "рик и морти";
kinoWarez.search(titleKino, kinoList);
kinoWarez.search(titleKino, kinoList, strong);
assertTrue(kinoList.size() > 0);
Kino kino = kinoList.get(0);
System.out.printf("\"%s\" (%s)", kino.getName(), kino.getUrl()); //DEBUG
// System.out.printf("\"%s\" (%s)", kino.getName(), kino.getUrl()); //DEBUG
assertTrue(kino.getName().toLowerCase().contains(titleKino.toLowerCase()));
}
}

View File

@@ -12,12 +12,21 @@ import static org.junit.Assert.*;
public class TestOnlinelife {
@Test
public void test() {
public void testNormal() {
search(false);
}
@Test
public void testStrong() {
search(true);
}
private void search(boolean strong) {
KinoWarez kinoWarez = new Onlinelife();
List<Kino> kinoList = new ArrayList<>();
String titleKino = "рик и морти";
kinoWarez.search(titleKino, kinoList);
kinoWarez.search(titleKino, kinoList, strong);
assertTrue(kinoList.size() > 0);