@Test public void visitWebsite() { Response response = HttpHandler.execute("https://www.webcalldirect.com/myaccount/getbalance.php", arguments); assertTrue(response.isResponseOke()); assertEquals("0", response.getResponse()); }
@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()); }
@Test public void exceptionTest() { Response response = HttpHandler.execute("http://wrong", arguments); assertFalse(response.isResponseOke()); assertEquals(R.string.ERR_CONN_ERR, response.getErrorCode()); }
@Test public void emptyArguments() { Response response = HttpHandler.execute("", null); assertFalse(response.isResponseOke()); assertEquals(R.string.ERR_NO_ARGUMENTS, response.getErrorCode()); }