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); } }); }
public async void CreateWallet_NullApiCode_ArgumentNullException() { await Assert.ThrowsAsync <ArgumentNullException>(async() => { using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper()) { await apiHelper.WalletCreator.Create("password"); } }); }
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); } }); }
public async void GetAddress_NegativeTransactions_ArgumentOutOfRangeException() { await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() => { using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper()) { await apiHelper.BlockExpolorer.GetAddressAsync("test", -1); } }); }
public async void ToBtc_NegativeValue_ArgumentOutOfRangeException() { await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() => { using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper()) { await apiHelper.exchangeRateExplorer.ToBtcAsync("USD", -1); } }); }
public async void CreateWallet_NullPassword_ArgumentNullException() { await Assert.ThrowsAsync <ArgumentNullException>(async() => { using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper("APICODE")) { await apiHelper.walletCreator.CreateAsync(null); } }); }
public async void GetXpub_NullXpub_ArgumentNullException() { await Assert.ThrowsAsync <ArgumentNullException>(async() => { using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper()) { await apiHelper.blockExplorer.GetXpub(null); } }); }
public async void GetChart_WrongName_OutOfRangeException() { await Assert.ThrowsAsync <ArgumentOutOfRangeException>(async() => { using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper()) { await apiHelper.statisticsExplorer.GetChartAsync("wrong-chart-name"); } }); }
public async void GetAddress_NullHash_ArgumentNullException() { await Assert.ThrowsAsync <ArgumentNullException>(async() => { using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper()) { await apiHelper.BlockExpolorer.GetAddressAsync(null); } }); }
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); } }); }
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); } }); }
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); } }); }
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); } }); }
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); } }); }
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); } }); }
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>()); } }); }
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)); } }); }