public void testInvoke() { string functionName = "set"; string[] args = { "args1", "9000" }; XooaClient xooaClient = new XooaClient(); xooaClient.setApiToken(XooaConstants.API_TOKEN); try { InvokeResponse invokeResponse = xooaClient.invoke(functionName, args); Assert.IsNotEmpty(invokeResponse.getTxnId()); Assert.IsNotEmpty(invokeResponse.getPayload()); } catch (XooaRequestTimeoutException xrte) { Assert.IsNotEmpty(xrte.getResultId()); Assert.IsNotEmpty(xrte.getResultUrl()); } }
public void testGetResultForInvoke() { XooaClient xooaClient = new XooaClient(); xooaClient.setApiToken(XooaConstants.API_TOKEN); string resultId = "63dc6290-053d-4469-8461-dcdf705d0943"; try { InvokeResponse invokeResponse = xooaClient.getResultForInvoke(resultId); Assert.IsNotEmpty(invokeResponse.getPayload()); Assert.IsNotEmpty(invokeResponse.getTxnId()); } catch (XooaRequestTimeoutException xrte) { Assert.IsNotEmpty(xrte.getResultUrl()); Assert.IsNotEmpty(xrte.getResultId()); Assert.AreEqual(resultId, xrte.getResultId()); } }