Beispiel #1
0
 @Test
 public void visitWebsite() {
   Response response =
       HttpHandler.execute("https://www.webcalldirect.com/myaccount/getbalance.php", arguments);
   assertTrue(response.isResponseOke());
   assertEquals("0", response.getResponse());
 }
Beispiel #2
0
 @Test
 public void wrongUrl() {
   Response response =
       HttpHandler.execute(
           "https://www.webcalldirect.com/myaccount/getbalancefake.php", arguments);
   assertFalse(response.isResponseOke());
   assertEquals(R.string.ERR_PROV_NO_RESP, response.getErrorCode());
 }
Beispiel #3
0
 @Test
 public void exceptionTest() {
   Response response = HttpHandler.execute("http://wrong", arguments);
   assertFalse(response.isResponseOke());
   assertEquals(R.string.ERR_CONN_ERR, response.getErrorCode());
 }
Beispiel #4
0
 @Test
 public void emptyArguments() {
   Response response = HttpHandler.execute("", null);
   assertFalse(response.isResponseOke());
   assertEquals(R.string.ERR_NO_ARGUMENTS, response.getErrorCode());
 }