Esempio n. 1
0
        public async void SendPayment_SendMultiBtc_NoFreeOutputs()
        {
            ServerApiException apiException = await Assert.ThrowsAsync <ServerApiException>(async() => {
                using (BlockchainApiHelper apiHelper = new BlockchainApiHelper())
                {
                    WalletHelper walletHelper = apiHelper.CreateWalletHelper(WalletTests.WALLET_ID, WalletTests.WALLET_PASSWORD, WalletTests.WALLET_PASSWORD2);
                    Dictionary <string, BitcoinValue> recipients = new Dictionary <string, BitcoinValue>()
                    {
                        { "17VYDFsDxBMovM1cKGEytgeqdijNcr4L5", BitcoinValue.FromBtc(1) }
                    };
                    await walletHelper.SendManyAsync(recipients);
                }
            });

            Assert.Contains("No free", apiException.Message);
        }
Esempio n. 2
0
        public async void SendMany_NullReeipients_ArgumentNUllException()
        {
            await Assert.ThrowsAsync <ArgumentException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    WalletHelper walletHelper = this.GetWalletHelper(apiHelper);
                    await walletHelper.SendManyAsync(null);
                }
            });

            await Assert.ThrowsAsync <ArgumentException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    WalletHelper walletHelper = this.GetWalletHelper(apiHelper);
                    await walletHelper.SendManyAsync(new Dictionary <string, BitcoinValue>());
                }
            });
        }