Ejemplo n.º 1
0
        public void Validate_Country()
        {
            var address = getDefaultAddress();
            var other   = getDefaultAddress(country: "US");

            Assert.IsTrue(AddressComparator.AreSimilar(address, other));
        }
Ejemplo n.º 2
0
        public void Validate_Line2()
        {
            var address = getDefaultAddress(line2: "Apt 23");

            var other1 = getDefaultAddress(line2: "apartMent 23");
            var other2 = getDefaultAddress(line2: "ap.23");
            var other3 = getDefaultAddress(line2: "#23   ");

            Assert.IsTrue(AddressComparator.AreSimilar(address, other1));
            Assert.IsTrue(AddressComparator.AreSimilar(address, other2));
            Assert.IsTrue(AddressComparator.AreSimilar(address, other3));
            Assert.IsTrue(AddressComparator.AreSimilar(other1, other2));
            Assert.IsTrue(AddressComparator.AreSimilar(other1, other3));
            Assert.IsTrue(AddressComparator.AreSimilar(other2, other3));
        }
Ejemplo n.º 3
0
        public void Validate_Line1()
        {
            var address = getDefaultAddress();

            var other1 = getDefaultAddress(line1: "587 Kiva Str.");
            var other2 = getDefaultAddress(line1: "587 Kiva St.");
            var other3 = getDefaultAddress(line1: "587 Kiva St");

            Assert.IsTrue(AddressComparator.AreSimilar(address, other1));
            Assert.IsTrue(AddressComparator.AreSimilar(address, other2));
            Assert.IsTrue(AddressComparator.AreSimilar(address, other3));
            Assert.IsTrue(AddressComparator.AreSimilar(other1, other2));
            Assert.IsTrue(AddressComparator.AreSimilar(other1, other3));
            Assert.IsTrue(AddressComparator.AreSimilar(other2, other3));
        }
Ejemplo n.º 4
0
        private Address getAddressFromJSON(JSONDataMap map)
        {
            if (map == null)
            {
                return(null);
            }

            var result = new Address();

            result.PersonName = map["name"].AsString();
            result.Line1      = map["street1"].AsString();
            result.Line2      = map["street2"].AsString();
            result.City       = map["city"].AsString();
            result.Region     = map["state"].AsString();
            result.Postal     = AddressComparator.GetPostalMainPart(map["zip"].AsString());
            result.Country    = NFX.Standards.Countries_ISO3166_1.Normalize3(map["country"].AsString());
            result.Phone      = map["phone"].AsString();
            result.EMail      = map["email"].AsString();

            return(result);
        }