Ejemplo n.º 1
0
        public void simple_synchronous_call_getbalance_returns_result_with_proxy()
        {
            AddressClient client = new AddressClient();
            Balance       result = client.GetBalance(Network.Doge, "DFundmtrigzA6E25Swr2pRe4Eb79bGP8G1", 500);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Status == Consts.Success);
            Assert.IsTrue(result.Data.Address == "DFundmtrigzA6E25Swr2pRe4Eb79bGP8G1");
        }
Ejemplo n.º 2
0
        public void should_simple_synchronous_call_getbalance_with_bad_address_throws_exception()
        {
            AddressClient client = new AddressClient();
            ExceptionWithMessage <AddressError> typedException = null;

            try
            {
                client.GetBalance(Network.Doge, Consts.Wrong, 1000000);
            }
            catch (Exception e)
            {
                typedException = e?.InnerException as ExceptionWithMessage <AddressError>;
            }
            Assert.IsNotNull(typedException);
            Assert.IsNotNull(typedException.ErrorMessage);
            Assert.IsTrue(typedException.ErrorMessage.Status == Consts.Fail);
            Assert.IsTrue(typedException.ErrorMessage.Data.Address == "A valid address is required");
        }