Braintree.Tests.Integration.PaymentMethodIntegrationTest.Create_CreatesPayPalAccountWithOneTimePaymentNonceFails C# (CSharp) Метод

Create_CreatesPayPalAccountWithOneTimePaymentNonceFails() приватный Метод

private Create_CreatesPayPalAccountWithOneTimePaymentNonceFails ( ) : void
Результат void
        public void Create_CreatesPayPalAccountWithOneTimePaymentNonceFails()
        {
            Result<Customer> result = gateway.Customer.Create(new CustomerRequest());
            Assert.IsTrue(result.IsSuccess());

            string nonce = TestHelper.GenerateOneTimePayPalNonce(gateway);
            var request = new PaymentMethodRequest
            {
                CustomerId = result.Target.Id,
                PaymentMethodNonce = nonce
            };
            Result<PaymentMethod> paymentMethodResult = gateway.PaymentMethod.Create(request);

            Assert.IsFalse(paymentMethodResult.IsSuccess());
            Assert.AreEqual(
                ValidationErrorCode.PAYPAL_ACCOUNT_CANNOT_VAULT_ONE_TIME_USE_PAYPAL_ACCOUNT,
                paymentMethodResult.Errors.ForObject("paypal-account").OnField("base")[0].Code
            );
        }
        
PaymentMethodIntegrationTest