Braintree.Tests.ClientTokenTest.Generate_RaisesExceptionIfVerifyCardIsIncludedWithoutCustomerId C# (CSharp) Метод

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

private Generate_RaisesExceptionIfVerifyCardIsIncludedWithoutCustomerId ( ) : void
Результат void
        public void Generate_RaisesExceptionIfVerifyCardIsIncludedWithoutCustomerId()
        {
            BraintreeGateway gateway = new BraintreeGateway
            {
                Environment = Environment.DEVELOPMENT,
                MerchantId = "integration_merchant_id",
                PublicKey = "integration_public_key",
                PrivateKey = "integration_private_key"
            };
            Exception exception = null;
            try {
                gateway.ClientToken.generate(
                    new ClientTokenRequest
                    {
                        Options = new ClientTokenOptionsRequest
                        {
                            VerifyCard = true
                        }
                    }
                );
            } catch (Exception tempException) {
                exception = tempException;
            }
            Assert.IsNotNull(exception);
            Assert.IsTrue(Regex.Match(exception.Message, @"VerifyCard").Success);
            Assert.IsInstanceOf(typeof(ArgumentException), exception);
        }