예제 #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 UsaCity GetRandomCity()
        {
            UsaCity city = cityList[Random.Next(cityList.Count())];

            String zip = Random.Next(city.ZipStart, city.ZipEnd).ToString("D5");

            return(city);
        }