forked from github/wulkanowy-mirror
@ -1,17 +0,0 @@
|
||||
package io.github.wulkanowy;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() throws Exception {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user