public void simple_synchronous_call_getblockhash_returns_result_with_proxy() { BlockClient client = new BlockClient(); BlockHash hash = client.GetBlockHash(Network.Doge, 200000); Assert.IsNotNull(hash); Assert.IsTrue(hash.Status == Consts.Success); Assert.IsTrue(hash.Data.Blockhash == "092fd3e76db5ff35fbfefe48d5c53ca26e799f0654a4036ddd5fd78de77418c2"); }
public void should_simple_synchronous_call_getblockhash_with_bad_height_throws_exception() { BlockClient client = new BlockClient(); ExceptionWithMessage <BlockHashError> typedException = null; try { client.GetBlockHash(Network.Doge, -1); } catch (Exception e) { typedException = e?.InnerException as ExceptionWithMessage <BlockHashError>; } Assert.IsNotNull(typedException); Assert.IsNotNull(typedException.ErrorMessage); Assert.IsTrue(typedException.ErrorMessage.Status == Consts.Fail); }