示例#1
0
        public async Task CreateCustomerAsync()
        {
            var firstName   = "Ivan" + new Random().Next(1, 1000);
            var email       = "ivan.ivanov" + Guid.NewGuid().ToString().Substring(0, 5) + "@skuvault.com";
            var newCustomer = new NetSuiteCustomer()
            {
                FirstName   = firstName,
                LastName    = "Ivanov",
                Email       = email,
                Phone       = "1-502-694-5210",
                CompanyName = "SkuVault",
                Address     = new NetSuiteAddress()
                {
                    Country    = "USA",
                    City       = "Louisville",
                    Region     = "KY",
                    Address1   = "2509 Plantside Drive",
                    PostalCode = "40299"
                }
            };

            await this._customersService.CreateCustomerAsync(newCustomer, CancellationToken.None);

            var nsCustomerInfo = await this._customersService.GetCustomerInfoByEmailAsync(email, CancellationToken.None);

            nsCustomerInfo.FirstName.Should().Be(firstName);
            nsCustomerInfo.LastName.Should().Be(newCustomer.LastName);
            nsCustomerInfo.Email.Should().Be(email);
        }
 public System.Threading.Tasks.Task <NetSuiteCustomer> CreateCustomerAsync(NetSuiteCustomer customer, CancellationToken token, Mark mark = null)
 {
     return(this._soapService.CreateCustomerAsync(customer, token, mark));
 }