public async void GetAddress_BadParameters_ArgumentException()
        {
            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetBase58AddressAsync("");
                }
            });

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetBase58AddressAsync("some-address", 60);
                }
            });

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetBase58AddressAsync("some-address", offset: -1);
                }
            });

            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetMultiAddressAsync(new List <string>());
                }
            });

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetMultiAddressAsync(new List <string>()
                    {
                        "address"
                    }, offset: -1);
                }
            });

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetMultiAddressAsync(new List <string>()
                    {
                        "address"
                    }, 101);
                }
            });
        }
 public async void GetBlocksByHeight_BadParameters_ArgumentException()
 {
     await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             await apiHelper.blockExplorer.GetBlocksAtHeightAsync(-1);
         }
     });
 }
Esempio n. 3
0
 public async void CreateWallet_NullApiCode_ArgumentNullException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             await apiHelper.WalletCreator.Create("password");
         }
     });
 }
Esempio n. 4
0
 public async void ToBtc_NullCurrency_ArgumentNullException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             await apiHelper.exchangeRateExplorer.ToBtcAsync(null, 1);
         }
     });
 }
 public async void GetTransaction_BadIds_ArgumentExecption()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             await apiHelper.transactionBroadcaster.PushTransactionAsync(null);
         }
     });
 }
Esempio n. 6
0
 public async void GetAddress_NegativeTransactions_ArgumentOutOfRangeException()
 {
     await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             await apiHelper.BlockExpolorer.GetAddressAsync("test", -1);
         }
     });
 }
Esempio n. 7
0
 public async void ToBtc_NegativeValue_ArgumentOutOfRangeException()
 {
     await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             await apiHelper.exchangeRateExplorer.ToBtcAsync("USD", -1);
         }
     });
 }
Esempio n. 8
0
 public async void CreateWallet_NullPassword_ArgumentNullException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper("APICODE"))
         {
             await apiHelper.walletCreator.CreateAsync(null);
         }
     });
 }
Esempio n. 9
0
 public async void GetXpub_NullXpub_ArgumentNullException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             await apiHelper.blockExplorer.GetXpub(null);
         }
     });
 }
Esempio n. 10
0
 public async void GetChart_WrongName_OutOfRangeException()
 {
     await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             await apiHelper.statisticsExplorer.GetChartAsync("wrong-chart-name");
         }
     });
 }
Esempio n. 11
0
 public async void GetAddress_NullHash_ArgumentNullException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             await apiHelper.BlockExpolorer.GetAddressAsync(null);
         }
     });
 }
Esempio n. 12
0
 public async void ArchiveAddress_NullAddress_ArgumentNullException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             WalletHelper walletHelper = this.GetWalletHelper(apiHelper);
             await walletHelper.ArchiveAddress(null);
         }
     });
 }
Esempio n. 13
0
 public async void GetAddress_BadParameters_ArgumentExceptions()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             Wallet.Wallet wallet = this.GetWallet(apiHelper);
             await wallet.GetAddressAsync(null);
         }
     });
 }
Esempio n. 14
0
 public async void ListAddresses_NegativeConfirmations_ArgumentOutOfRangeException()
 {
     await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             WalletHelper walletHelper = this.GetWalletHelper(apiHelper);
             await walletHelper.ListAddressesAsync(-1);
         }
     });
 }
        public async void GetTransaction_BadIds_ArgumentExecption()
        {
            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.BlockExpolorer.GetTransactionAsync(null);
                }
            });

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.BlockExpolorer.GetTransactionByIndexAsync(-1);
                }
            });
        }
Esempio n. 16
0
        public async void GetChart_WrongTimespan_OutOfRangeException()
        {
            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.statisticsExplorer.GetChartAsync("hash-rate", "wrong-timespan-format");
                }
            });

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.statisticsExplorer.GetPoolsAsync(0);
                }
            });
        }
        public async void ReceiveFunds_NullParameters_ArgumentNullExceptions()
        {
            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.FundReceiver.ReceiveFundsAsync(null, "callback");
                }
            });

            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.FundReceiver.ReceiveFundsAsync("address", null);
                }
            });
        }
Esempio n. 18
0
        public async void GetBlocks_BadParameters_ArgumentException()
        {
            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetBlocksByTimestampAsync(-1);
                }
            });


            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetBlocksByTimestampAsync(1000);
                }
            });

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetBlocksByTimestampAsync(int.MaxValue);
                }
            });


            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetBlocksByDateTimeAsync(DateTime.MinValue);
                }
            });

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.blockExplorer.GetBlocksByDateTimeAsync(DateTime.MaxValue);
                }
            });
        }
Esempio n. 19
0
        public async void FromBtc_NegativeValue_ArgumentOutOfRangeException()
        {
            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    var btc = new BitcoinValue(new decimal(-0.4));
                    await apiHelper.exchangeRateExplorer.FromBtcAsync(btc);
                }
            });

            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    await apiHelper.exchangeRateExplorer.FromBtcAsync(null);
                }
            });
        }
Esempio n. 20
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>());
                }
            });
        }
Esempio n. 21
0
        public async void Send_BadParameters_ArgumentExceptions()
        {
            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    WalletHelper walletHelper = this.GetWalletHelper(apiHelper);
                    await walletHelper.SendAsync(null, BitcoinValue.Zero);
                }
            });

            await Assert.ThrowsAsync <ArgumentException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
                {
                    WalletHelper walletHelper = this.GetWalletHelper(apiHelper);
                    await walletHelper.SendAsync("Test", BitcoinValue.FromBtc(-1));
                }
            });
        }