Braintree.Tests.Integration.CustomerIntegrationTest.Create_CreatesCustomerWithSpecifiedValues C# (CSharp) Метод

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

private Create_CreatesCustomerWithSpecifiedValues ( ) : void
Результат void
        public void Create_CreatesCustomerWithSpecifiedValues()
        {
            var createRequest = new CustomerRequest()
            {
                FirstName = "Michael",
                LastName = "Angelo",
                Company = "Some Company",
                Email = "[email protected]",
                Phone = "312.555.1111",
                Fax = "312.555.1112",
                Website = "www.example.com",
                CreditCard = new CreditCardRequest()
                {
                    Number = "5105105105105100",
                    ExpirationDate = "05/12",
                    BillingAddress = new CreditCardAddressRequest
                    {
                        CountryName = "Macau",
                        CountryCodeAlpha2 = "MO",
                        CountryCodeAlpha3 = "MAC",
                        CountryCodeNumeric = "446"
                    }
                }
            };

            Customer customer = gateway.Customer.Create(createRequest).Target;
            Assert.AreEqual("Michael", customer.FirstName);
            Assert.AreEqual("Angelo", customer.LastName);
            Assert.AreEqual("Some Company", customer.Company);
            Assert.AreEqual("[email protected]", customer.Email);
            Assert.AreEqual("312.555.1111", customer.Phone);
            Assert.AreEqual("312.555.1112", customer.Fax);
            Assert.AreEqual("www.example.com", customer.Website);
            Assert.AreEqual(DateTime.Now.Year, customer.CreatedAt.Value.Year);
            Assert.AreEqual(DateTime.Now.Year, customer.UpdatedAt.Value.Year);

            Address billingAddress = customer.CreditCards[0].BillingAddress;
            Assert.AreEqual("Macau", billingAddress.CountryName);
            Assert.AreEqual("MO", billingAddress.CountryCodeAlpha2);
            Assert.AreEqual("MAC", billingAddress.CountryCodeAlpha3);
            Assert.AreEqual("446", billingAddress.CountryCodeNumeric);
        }
CustomerIntegrationTest