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