Пример #1
0
        public void simple_synchronous_call_getconfidence_returns_result()
        {
            TransactionClient client = new TransactionClient();
            Confidence        result = client.GetConfidence(Network.Bitcoin, "871265cc6efa69a749282321b19a22d3ed6cccff1995d1ce34323a6006b943eb");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Status == Consts.Success);
            Assert.IsTrue(result.Data.Txid == "871265cc6efa69a749282321b19a22d3ed6cccff1995d1ce34323a6006b943eb");
        }
Пример #2
0
        public void should_simple_synchronous_call_getconfidence_with_bad_address_throws_exception()
        {
            TransactionClient client = new TransactionClient();
            ExceptionWithMessage <TxidError> typedException = null;

            try
            {
                client.GetConfidence(Network.Doge, Consts.Wrong);
            }
            catch (Exception e)
            {
                typedException = e?.InnerException as ExceptionWithMessage <TxidError>;
            }
            Assert.IsNotNull(typedException);
            Assert.IsNotNull(typedException.ErrorMessage);
            Assert.IsTrue(typedException.ErrorMessage.Status == Consts.Fail);
            Assert.IsTrue(typedException.ErrorMessage.Data.Txid == Consts.ValidTxHashRequired);
        }