Example #1
0
        public async Task can_withdrawal()
        {
            SetupServerSingleResponse(Withdrawal1);

            var create = new WithdrawalFunds
            {
                Amount        = 10.0m,
                Currency      = "USD",
                PaymentMethod = "B28EB04F-BD70-4308-90A1-96065283A001"
            };
            var r = await client.Withdrawals.WithdrawalFundsAsync("fff", create);

            var truth = new Response <Withdrawal>
            {
                Data = Withdrawal1Model
            };

            truth.Should().BeEquivalentTo(r);

            server.ShouldHaveRequestBody(
                @"{""amount"":10.0,""currency"":""USD"",""payment_method"":""B28EB04F-BD70-4308-90A1-96065283A001"",""commit"":false}");

            server.ShouldHaveExactCall($"https://api.coinbase.com/v2/accounts/fff/withdrawals")
            .WithVerb(HttpMethod.Post);
        }
 Task <Response <Withdrawal> > IWithdrawalsEndpoint.WithdrawalFundsAsync(string accountId, WithdrawalFunds withdrawalFunds, CancellationToken cancellationToken)
 {
     return(this.AccountsEndpoint
            .AppendPathSegmentsRequire(accountId, withdrawals)
            .WithClient(this)
            .PostJsonAsync(withdrawalFunds, cancellationToken)
            .ReceiveJson <Response <Withdrawal> >());
 }