コード例 #1
0
 public async void Unarchive_NullAddress_ArgumentNulException()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(async() =>
     {
         using (BlockchainApiHelper apiHelper = UnitTestUtil.GetFakeHelper())
         {
             WalletHelper walletHelper = this.GetWalletHelper(apiHelper);
             await walletHelper.UnarchiveAddress(null);
         }
     });
 }
コード例 #2
0
        public async void Unarchive_BadAddress_ServerApiException()
        {
            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);
                    await walletHelper.UnarchiveAddress("BadAddress");
                }
            });

            Assert.Contains("Checksum", apiException.Message);
        }
コード例 #3
0
        public async void NewAddress_ArchiveThenConsolidate_Valid()
        {
            using (BlockchainApiHelper apiHelper = new BlockchainApiHelper())
            {
                WalletHelper walletHelper = apiHelper.CreateWalletHelper(WalletTests.WALLET_ID, WalletTests.WALLET_PASSWORD, WalletTests.WALLET_PASSWORD2);
                Address      address      = await walletHelper.NewAddress("Test");

                Assert.NotNull(address);

                string archivedAddress = await walletHelper.ArchiveAddress(address.AddressStr);

                Assert.NotNull(archivedAddress);


                string unarchivedAddress = await walletHelper.UnarchiveAddress(archivedAddress);

                Assert.NotNull(unarchivedAddress);
            }
        }