Create api package (#4)

Create api package and move login's implementation to it
This commit is contained in:
Mikołaj Pich
2017-07-21 19:59:13 +02:00
committed by GitHub
parent 4b425f9b39
commit 3a7cb3b904
15 changed files with 221 additions and 216 deletions

View File

@ -1,28 +0,0 @@
package io.github.wulkanowy.activity.main;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.junit.Test;
import static org.junit.Assert.*;
public class CheckPassTest {
@Test
public void testFailureLogin() throws Exception {
String html = "<div class='ErrorMessage center'>Zła nazwa użytkownika lub hasło</div>";
Document doc = Jsoup.parse(html);
CheckPass obj = new CheckPass(doc);
assertFalse(obj.isLogged());
}
@Test
public void testSuccessfulLogin() throws Exception {
String html = "<title>Working...</title>";
Document doc = Jsoup.parse(html);
CheckPass check = new CheckPass(doc);
assertTrue(check.isLogged());
}
}

View File

@ -0,0 +1,13 @@
package io.github.wulkanowy.api.login;
import org.junit.Test;
import static org.junit.Assert.*;
public class LoginTest {
@Test
public void login() throws Exception {
assertEquals(4, 2 + 2);
}
}