Пример #1
0
 public void TestUsCityStateZipCtorPickWithMsa()
 {
     var addrData = new AddressData { StateAbbrv = "FL", PostalCode = "32701" };
     var testResult = new UsCityStateZip(addrData);
     Assert.AreNotEqual("New York", testResult.City);
     Assert.IsNotNull(testResult.Msa);
     System.Diagnostics.Debug.WriteLine(testResult.City);
 }
Пример #2
0
        /// <summary>
        /// Determine if the given <see cref="NorthAmerican"/> is renting or has a mortgage
        /// </summary>
        /// <param name="usCityArea"></param>
        /// <returns></returns>
        protected internal bool GetIsLeaseResidence(UsCityStateZip usCityArea)
        {
            var cannotGetFinanced = CreditScore.GetRandomInterestRate(null, Gov.Fed.RiskFreeInterestRate.DF_VALUE) > 8.5;
            if (cannotGetFinanced)
                return true;

            var livesInDenseUrbanArea = usCityArea.Msa?.MsaType == (UrbanCentric.City | UrbanCentric.Large);
            var isYoung = _amer.GetAgeAt(null) < 32;
            var roll = 65;
            if (livesInDenseUrbanArea)
                roll -= 23;
            //is scaled where 29 year-old loses 3 while 21 year-old loses 11
            if (isYoung)
                roll -= 32 - _amer.GetAgeAt(null);
            return Etx.TryBelowOrAt(roll, Etx.Dice.OneHundred);
        }
Пример #3
0
 public void TestUsCityStateZipCtor()
 {
     var addrData = new AddressData {StateAbbrv = "NV", PostalCode = "89421"};
     var testResult = new UsCityStateZip(addrData);
     Assert.AreNotEqual("New York", testResult.City);
     System.Diagnostics.Debug.WriteLine(testResult.City);
 }
Пример #4
0
        public static bool TryParse(string lastLine, out UsCityStateZip cityStateZip)
        {
            if (String.IsNullOrWhiteSpace(lastLine))
            {
                cityStateZip = null;
                return false;
            }
            lastLine = lastLine.Trim();

            var addrData = new AddressData
                           {
                               PostalCode = String.Empty,
                               PostalCodeSuffix = String.Empty,
                               StateAbbrv = String.Empty,
                               City = String.Empty
                           };
            GetZipCode(lastLine, addrData);

            GetState(lastLine, addrData);

            GetCity(lastLine, addrData);

            cityStateZip = new UsCityStateZip(addrData);
            return true;
        }