Exemplo n.º 1
0
 public async void ArchiveAddress_NullAddress_ArgumentNullException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             Wallet.Wallet wallet = GetWallet(apiHelper);
             await wallet.ArchiveAddressAsync(null);
         }
     });
 }
Exemplo n.º 2
0
        public async void ArchiveAddress_BadAddress_ServerApiException()
        {
            ServerApiException apiException = await Assert.ThrowsAsync <ServerApiException>(async() =>
            {
                using (BlockchainApiHelper apiHelper = new BlockchainApiHelper())
                {
                    Wallet.Wallet wallet = apiHelper.InitializeWallet(WalletTests.WALLET_ID, WalletTests.WALLET_PASSWORD,
                                                                      WalletTests.WALLET_PASSWORD2);
                    await wallet.ArchiveAddressAsync("badAddress");
                }
            });

            Assert.Contains("Checksum", apiException.Message);
        }
Exemplo n.º 3
0
        public async void NewAddress_ArchiveThenConsolidate_Valid()
        {
            using (BlockchainApiHelper apiHelper = new BlockchainApiHelper())
            {
                Wallet.Wallet wallet  = apiHelper.InitializeWallet(WalletTests.WALLET_ID, WalletTests.WALLET_PASSWORD, WalletTests.WALLET_PASSWORD2);
                WalletAddress address = await wallet.NewAddressAsync("Test");

                Assert.NotNull(address);

                string archivedAddress = await wallet.ArchiveAddressAsync(address.AddressStr);

                Assert.NotNull(archivedAddress);


                string unarchivedAddress = await wallet.UnarchiveAddressAsync(archivedAddress);

                Assert.NotNull(unarchivedAddress);
            }
        }