Beispiel #1
0
        public static UsStreetPo RandomAmericanStreet()
        {
            var addressData = new AddressData();

            addressData.ThoroughfareNumber = Etx.RandomCoinToss()
                ? Etx.MyRand.Next(0, 2999).ToString(CultureInfo.InvariantCulture)
                : Etx.MyRand.Next(0, 29999).ToString(CultureInfo.InvariantCulture);

            addressData.ThoroughfareName = UsStreetPo.RandomAmericanStreetName();
            if (!Etx.RandomRollBelowOrAt(6, Etx.Dice.OneHundred))
            {
                addressData.ThoroughfareType = UsStreetPo.RandomAmericanStreetKind();
            }

            if (Etx.RandomRollBelowOrAt(20, Etx.Dice.OneHundred))
            {
                addressData.ThoroughfareDirectional = Etx.RandomPickOne(UsStreetPo.UsPostalDirectionalAbbrev);
            }

            if (Etx.RandomRollBelowOrAt(13, Etx.Dice.OneHundred))
            {
                addressData.SecondaryUnitDesignator = UsStreetPo.RandomAmericanAddressLine2();
            }

            return(new UsStreetPo(addressData));
        }
Beispiel #2
0
 public void TestRandomAmericanStreetKind()
 {
     for (var i = 0; i < 25; i++)
     {
         var testResult = UsStreetPo.RandomAmericanStreetKind();
         Assert.IsNotNull(testResult);
         Console.WriteLine(testResult);
     }
 }