Пример #1
0
        public void simple_synchronous_call_getshortaddress_returns_result()
        {
            SimpleClient client  = new SimpleClient();
            ShortAddress address = client.GetShortAddress(Network.Doge, "DSfnDweXHwQmUYhprkNpmGo3nuvKepF851");

            Assert.IsTrue(address != null && address.Status == Consts.Success);
        }
Пример #2
0
        public void should_simple_synchronous_call_getshortaddress_with_bad_address_throws_exception()
        {
            SimpleClient client = new SimpleClient();
            ExceptionWithMessage <CommonError> typedException = null;

            try
            {
                client.GetShortAddress(Network.BitcoinTest, Consts.Wrong);
            }
            catch (Exception e)
            {
                typedException = e?.InnerException as ExceptionWithMessage <CommonError>;
            }
            Assert.IsNotNull(typedException);
            Assert.IsNotNull(typedException.ErrorMessage);
            Assert.IsTrue(typedException.ErrorMessage.Code == 404);
            Assert.IsTrue(typedException.ErrorMessage.Message == "Invalid long/short address");
        }