Beispiel #1
0
        public void simple_synchronous_call_gettxinputs_returns_result()
        {
            TransactionClient client = new TransactionClient();
            TxInputs          result = client.GetTxInputs(Network.Doge, "6f47f0b2e1ec762698a9b62fa23b98881b03d052c9d8cb1d16bb0b04eb3b7c5b");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Status == Consts.Success);
            Assert.IsTrue(result.Data.Txid == "6f47f0b2e1ec762698a9b62fa23b98881b03d052c9d8cb1d16bb0b04eb3b7c5b");
        }
Beispiel #2
0
        public void should_simple_synchronous_call_gettxinputs_with_bad_address_throws_exception()
        {
            TransactionClient client = new TransactionClient();
            ExceptionWithMessage <TxidInputError> typedException = null;

            try
            {
                client.GetTxInputs(Network.Doge, Consts.Wrong);
            }
            catch (Exception e)
            {
                typedException = e?.InnerException as ExceptionWithMessage <TxidInputError>;
            }
            Assert.IsNotNull(typedException);
            Assert.IsNotNull(typedException.ErrorMessage);
            Assert.IsTrue(typedException.ErrorMessage.Status == Consts.Fail);
            Assert.IsTrue(typedException.ErrorMessage.Data.Txid == Consts.ValidTxHashRequired);
            Assert.IsTrue(typedException.ErrorMessage.Data.InputNo == "Valid input number (optional)");
        }