public void simple_synchronous_call_istxspent_returns_result() { int outputNum = 0; TransactionClient client = new TransactionClient(); TxOutputSpent result = client.IsTxOutputSpent(Network.Doge, "6f47f0b2e1ec762698a9b62fa23b98881b03d052c9d8cb1d16bb0b04eb3b7c5b", outputNum); Assert.IsNotNull(result); Assert.IsTrue(result.Status == Consts.Success); Assert.IsTrue(result.Data.Txid == "6f47f0b2e1ec762698a9b62fa23b98881b03d052c9d8cb1d16bb0b04eb3b7c5b"); Assert.IsTrue(result.Data.OutputNo == outputNum); Assert.IsTrue(result.Data.IsSpent); }
public void should_simple_synchronous_call_istxoutputspent_with_bad_address_throws_exception() { TransactionClient client = new TransactionClient(); ExceptionWithMessage <TxidOutputError> typedException = null; try { client.IsTxOutputSpent(Network.Doge, Consts.Wrong, 0); } catch (Exception e) { typedException = e?.InnerException as ExceptionWithMessage <TxidOutputError>; } Assert.IsNotNull(typedException); Assert.IsNotNull(typedException.ErrorMessage); Assert.IsTrue(typedException.ErrorMessage.Status == Consts.Fail); string withUppercaseFirst = Consts.ValidTxHashRequired.First().ToString().ToUpper() + String.Join("", Consts.ValidTxHashRequired.ToLower().Skip(1)); Assert.IsTrue(typedException.ErrorMessage.Data.Txid == withUppercaseFirst); Assert.IsTrue(typedException.ErrorMessage.Data.OutputNo == "Valid output number is required"); }