コード例 #1
0
        public void WhenIFillPrimaryContactForm(string modification)
        {
            ContactForm form;

            if (Ctx.NewAccount)
            {
                form = new ContactForm
                {
                    FirstName    = "F" + RandUtils.RandomName(9),
                    LastName     = "L" + RandUtils.RandomName(9),
                    CompanyName  = "C" + RandUtils.RandomString(9),
                    Email        = "E" + RandUtils.RandomString(6) + "@test.com.block",
                    PhoneNumber  = "1" + RandUtils.RandomNumber(9),
                    AddressLine1 = "1009 Lenox Dr",
                    AddressLine2 = "",
                    City         = "Lawrence Township",
                    State        = "NJ",
                    Zip          = "08648",
                    Country      = "United States"
                };
            }
            else
            {
                var acct = Ctx.OriginalAccount;
                form = new ContactForm(acct.PrimaryContact, acct.PrimaryAddress);
            }

            if (modification.Length > 0)
            {
                form.FirstName    = "F" + RandUtils.RandomName(9);
                form.LastName     = "L" + RandUtils.RandomName(9);
                form.Email        = "E" + RandUtils.RandomString(6) + "@test.com.block";
                form.PhoneNumber  = "1" + RandUtils.RandomNumber(9);
                form.AddressLine1 = "1009 Lenox Dr";
                form.AddressLine2 = "";
                form.City         = "Lawrence Township";
                form.State        = "NJ";
                form.Zip          = "08648";
                form.Country      = "United States";
            }

            Ctx.PrimaryContact = form;

            new Pages.CSA.ContactDetails(Driver).FillPrimaryContact(
                form.FirstName,
                form.LastName,
                form.CompanyName,
                form.Email,
                form.PhoneNumber,
                form.City,
                form.State,
                form.Zip,
                form.AddressLine1,
                form.AddressLine2,
                form.Country
                );

            Console.WriteLine($"company={form.CompanyName} name={form.LastName}, {form.FirstName}");
        }