public void testGetResultForBlockByNumber() { XooaClient xooaClient = new XooaClient(); xooaClient.setApiToken(XooaConstants.API_TOKEN); string resultId = "07ce7042-67d8-431f-84a8-fdb3f4145225"; try { BlockResponse blockResponse = xooaClient.getResultForBlockByNumber(resultId); Assert.IsNotEmpty(blockResponse.getBlockNumber().ToString()); Assert.IsNotEmpty(blockResponse.getDataHash()); Assert.IsNotEmpty(blockResponse.getNumberOfTransactions().ToString()); Assert.IsNotEmpty(blockResponse.getPreviousHash()); } catch (XooaRequestTimeoutException xrte) { Assert.IsNotEmpty(xrte.getResultUrl()); Assert.IsNotEmpty(xrte.getResultId()); Assert.AreEqual(resultId, xrte.getResultId()); } }
public void testGetBlockByNumber() { XooaClient xooaClient = new XooaClient(); xooaClient.setApiToken(XooaConstants.API_TOKEN); try { BlockResponse br = xooaClient.getBlockByNumber("10"); Assert.IsNotNull(br.getBlockNumber()); Assert.IsNotEmpty(br.getDataHash()); Assert.IsNotEmpty(br.getPreviousHash()); Assert.IsNotNull(br.getNumberOfTransactions()); Assert.AreEqual(10, br.getBlockNumber(), "Block Numbers do not match"); } catch (XooaRequestTimeoutException xrte) { Assert.IsNotEmpty(xrte.getResultId()); Assert.IsNotEmpty(xrte.getResultUrl()); } }