예제 #1
0
        public void ToStringTest()
        {
            PostalAddress target   = new PostalAddress(); // TODO: Initialize to an appropriate value
            string        expected = string.Empty;        // TODO: Initialize to an appropriate value
            string        actual;

            actual = target.ToString();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
예제 #2
0
        public void TestValueSetter()
        {
            var crlf        = new string(new[] { Constants.CR, Constants.LF });
            var testInput   = $"1600 Pennsylvania Avenue NW{crlf}Washington, DC 20500";
            var testSubject = new PostalAddress {
                Value = testInput
            };

            Assert.IsNotNull(testSubject.CityArea);
            Assert.IsNotNull(testSubject.Street);
            Assert.IsInstanceOf(typeof(UsCityStateZip), testSubject.CityArea);
            Console.WriteLine(testSubject.ToString());

            testInput   = $"80 Wellington St{crlf}Ottawa, ON K1A 0A2";
            testSubject = new PostalAddress {
                Value = testInput
            };
            Assert.IsNotNull(testSubject.CityArea);
            Assert.IsNotNull(testSubject.Street);
            Assert.IsInstanceOf(typeof(CaCityProvidencePost), testSubject.CityArea);
            Console.WriteLine(testSubject.ToString());
        }
예제 #3
0
        public GeoPoint GetGeoCodingFor(PostalAddress address)
        {
            _logService.Debug("Calling GeoCodeLookupProvider to geocode address {0}", address.ToString());

            var geoPoint = GetGeoPointFor(address.Postcode);

            if (!geoPoint.IsSet() && AddressIsSet(address))
            {
                geoPoint = GetGeoPointFor(GetServiceAddressFrom(address));
            }

            return(geoPoint);
        }