Esempio n. 1
0
        /// <summary>
        /// Generate Customer Account
        /// </summary>
        /// <param name="taxExempt"></param>
        /// <param name="taxId"></param>
        /// <returns></returns>
        public static CustomerAccountAndAuthInfo GenerateCustomerAccountAndAuthInfoRandom(bool taxExempt = false, string taxId = null)
        {
            var firstname = Generator.RandomString(8, RandomCharacterGroup.AlphaOnly);
            var lastname = Generator.RandomString(8, RandomCharacterGroup.AlphaOnly);
            var username = firstname + lastname; // or use Generator.RandomString(12, RandomCharacterGroup.AlphaOnly);
            var customer = new CustomerAccount()
            {
                AcceptsMarketing = false,
                CompanyOrOrganization = "Volusion",
                Contacts = new List<CustomerContact>() { GenerateCustomerContact(0, GenerateAddressRandom(addressType: AddressType.Residential), username + "@mozu.com", firstname, "", lastname) },
                EmailAddress = username + "@mozu.com",//Generator.RandomEmailAddress(),
                FirstName = firstname, // or use Generator.RandomString(10, RandomCharacterGroup.AlphaOnly),
                LastName = lastname, // or use Generator.RandomString(10, RandomCharacterGroup.AlphaOnly),
                UserName = username,
                TaxExempt = taxExempt,
                TaxId = taxId,
                LocaleCode = Constant.LocaleCode,
                Notes = new List<CustomerNote>() { GenerateCustomerNote() }
            };

            var customerAccountAndAuthInfo = new CustomerAccountAndAuthInfo
            {
                Account = customer,
                Password = Constant.Password
            };

            return customerAccountAndAuthInfo;
        }
Esempio n. 2
0
        /// <summary>
        /// Generate Customer Account
        /// </summary>
        /// <param name="customerAccount"></param>
        /// <returns></returns>
        public static CustomerAccountAndAuthInfo GenerateCustomerAccountAndAuthInfo(CustomerAccount customerAccount)
        {
            var customerAccountAndAuthInfo = new CustomerAccountAndAuthInfo
            {
                Account = customerAccount,
                Password = Constant.Password
            };

            return customerAccountAndAuthInfo;
        }