public void testGetCurrentBlockResponse() { XooaClient xooaClient = new XooaClient(); xooaClient.setApiToken(XooaConstants.API_TOKEN); try { CurrentBlockResponse cbr = xooaClient.getCurrentBlock(); Assert.IsNotEmpty(cbr.getBlockNumber().ToString()); Assert.IsNotEmpty(cbr.getCurrentBlockHash()); Assert.IsNotEmpty(cbr.getPreviousBlockHash()); } catch (XooaRequestTimeoutException xrte) { //Assert.AreEqual(typeof(XooaRequestTimeoutException), xrte.GetType()); Assert.IsNotEmpty(xrte.getResultId()); Assert.IsNotEmpty(xrte.getResultUrl()); } }
public void testGetResultForCurrentBlock() { XooaClient xooaClient = new XooaClient(); xooaClient.setApiToken(XooaConstants.API_TOKEN); string resultId = "75b9f849-389e-4a2d-9717-5f47cc3a688b"; try { CurrentBlockResponse currentBlock = xooaClient.getResultForCurrentBlock(resultId); Assert.IsNotEmpty(currentBlock.getBlockNumber().ToString()); Assert.IsNotEmpty(currentBlock.getCurrentBlockHash()); Assert.IsNotEmpty(currentBlock.getPreviousBlockHash()); } catch (XooaRequestTimeoutException xrte) { Assert.IsNotEmpty(xrte.getResultUrl()); Assert.IsNotEmpty(xrte.getResultId()); Assert.AreEqual(resultId, xrte.getResultId()); } }