Exemplo n.º 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());
 }
Exemplo n.º 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());
 }
Exemplo n.º 3
0
 @Test
 public void exceptionTest() {
   Response response = HttpHandler.execute("http://wrong", arguments);
   assertFalse(response.isResponseOke());
   assertEquals(R.string.ERR_CONN_ERR, response.getErrorCode());
 }
Exemplo n.º 4
0
 @Test
 public void emptyArguments() {
   Response response = HttpHandler.execute("", null);
   assertFalse(response.isResponseOke());
   assertEquals(R.string.ERR_NO_ARGUMENTS, response.getErrorCode());
 }