forked from github/wulkanowy-mirror
Create api package (#4)
Create api package and move login's implementation to it
This commit is contained in:
@ -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());
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user