コード例 #1
0
        public void Test_Wallets_Save()
        {
            WalletDTO    wallet    = this.GetJohnsWallet();
            WalletPutDTO walletPut = new WalletPutDTO();

            walletPut.Description = wallet.Description + " - changed";
            walletPut.Owners      = wallet.Owners;
            walletPut.Tag         = wallet.Tag;

            WalletDTO saveWallet = this.Api.Wallets.Update(walletPut, wallet.Id);

            Assert.AreEqual(wallet.Id, saveWallet.Id);
            Assert.AreEqual(wallet.Description + " - changed", saveWallet.Description);
        }
コード例 #2
0
        public void Test_Wallets_Save()
        {
            WalletDTO    wallet    = TestHelper.GetJohnsWallet();
            WalletPutDTO walletPut = new WalletPutDTO();

            walletPut.Description = wallet.Description + " - changed";
            walletPut.Owners      = wallet.Owners;
            walletPut.Tag         = wallet.Tag;

            WalletDTO saveWallet = _objectToTest.Update(walletPut, wallet.Id).Result;

            Assert.Equal(wallet.Id, saveWallet.Id);
            Assert.Equal(wallet.Description + " - changed", saveWallet.Description);
        }
コード例 #3
0
        public async Task Test_Wallets_Save()
        {
            WalletDTO wallet = await this.GetJohnsWallet();

            WalletPutDTO walletPut = new WalletPutDTO
            {
                Description = wallet.Description + " - changed",
                Owners      = wallet.Owners,
                Tag         = wallet.Tag
            };

            WalletDTO saveWallet = await this.Api.Wallets.UpdateAsync(walletPut, wallet.Id);

            Assert.AreEqual(wallet.Id, saveWallet.Id);
            Assert.AreEqual(wallet.Description + " - changed", saveWallet.Description);
        }
コード例 #4
0
 /// <summary>Updates wallet.</summary>
 /// <param name="wallet">Wallet object to save.</param>
 /// <param name="walletId">Wallet identifier.</param>
 /// <returns>Wallet instance returned from API.</returns>
 public WalletDTO Update(WalletPutDTO wallet, String walletId)
 {
     return(this.UpdateObject <WalletDTO, WalletPutDTO>(MethodKey.WalletsSave, wallet, walletId));
 }
コード例 #5
0
        public async Task <WalletDTO> Update(WalletPutDTO wallet, string walletId)
        {
            var targetUrl = $"{_baseUrl}/wallets/{walletId}";

            return(await UpdateEntity <WalletDTO, WalletPutDTO>(targetUrl, wallet));
        }
コード例 #6
0
 /// <summary>Updates wallet.</summary>
 /// <param name="wallet">Wallet object to save.</param>
 /// <param name="walletId">Wallet identifier.</param>
 /// <returns>Wallet instance returned from API.</returns>
 public async Task <WalletDTO> UpdateAsync(WalletPutDTO wallet, String walletId)
 {
     return(await this.UpdateObjectAsync <WalletDTO, WalletPutDTO>(MethodKey.WalletsSave, wallet, walletId));
 }