Пример #1
0
        public void Generate()
        {
            FirstName = DataGenerator.GetRandomFirstName();
            LastName  = DataGenerator.GetRandomLastName();
            Email     = string.Format("{0}.{1}@TestEmail.com", FirstName, LastName);
            SSN       = DataGenerator.GetRandomSSN();

            UsaCity city = UsaCities.GetRandomCity();
            string  zip  = city.GetRandomZipCode();

            Address.Zip   = zip;
            Address.State = city.StateCode;
            Address.City  = city.CityName;


            UsaState state = UsaStates.GetState(city.StateCode);

            CellPhone.AreaCode     = UsaStates.GetRandomAreaCode(state);
            CellPhone.PhoneDetail1 = DataGenerator.GetRandomNumber3();
            CellPhone.PhoneDetail2 = DataGenerator.GetRandomNumber4();
            CellPhone.PhoneNumber  = CellPhone.ToString();

            if (city.AreaCodes.Length > 0)
            {
                CellPhone.AreaCode    = city.GetRandomAreaCode();
                CellPhone.PhoneNumber = CellPhone.ToString();
            }

            LoginName = string.Format("{0}{1}", LastName, FirstName);
        }
Пример #2
0
        static public string GetRandomAreaCode(UsaState state)
        {
            string areaCode = "";

            string[] areaCodeList = state.AreaCodes.Split('-');
            areaCode = areaCodeList[Random.Next(areaCodeList.Count())];

            return(areaCode.Trim());
        }
Пример #3
0
        static public UsaState GetState(string StateCode)
        {
            UsaState state = null;

            foreach (UsaState item in stateList)
            {
                if (item.Abbrev.Equals(StateCode))
                {
                    return(item);
                }
            }

            return(state);
        }
Пример #4
0
        public static string GetRandomAreaCode(UsaState state)
        {
            string areaCode = "";

            string[] areaCodeList = state.AreaCodes.Split('-');
            areaCode = areaCodeList[Random.Next(areaCodeList.Count())];

            return areaCode.Trim();
        }