Ejemplo n.º 1
0
        public void TestEquality()
        {
            var addressNumber = Path.GetRandomFileName();
            var postalCode = Path.GetRandomFileName();
            var city = Path.GetRandomFileName();
            var streetName = Path.GetRandomFileName();
            var stateAbbrv = Path.GetRandomFileName();
            var streetType = Path.GetRandomFileName();
            var testSubject =
                new UsStreetPo(new AddressData()
                {
                    AddressNumber = addressNumber,
                    PostalCode = postalCode,
                    City = city,
                    StreetName = streetName,
                    StateAbbrv = stateAbbrv,
                    StreetType = streetType
                });

            Assert.IsFalse(testSubject.Equals(null));
            Assert.IsFalse(testSubject.Equals(new UsStreetPo(new AddressData())));

            var testAreEqual = new UsStreetPo(new AddressData()
                {
                    AddressNumber = addressNumber,
                    PostalCode = postalCode,
                    City = city,
                    StreetName = streetName,
                    StateAbbrv = stateAbbrv,
                    StreetType = streetType
                });

            Assert.IsTrue(testSubject.Equals(testAreEqual));

            testAreEqual.Data.AddressNumber = testAreEqual.Data.AddressNumber.ToUpper();

            Assert.IsTrue(testSubject.Equals(testAreEqual));
        }
Ejemplo n.º 2
0
        public void TestEquality()
        {
            var addressNumber = Path.GetRandomFileName();
            var postalCode    = Path.GetRandomFileName();
            var city          = Path.GetRandomFileName();
            var streetName    = Path.GetRandomFileName();
            var stateAbbrv    = Path.GetRandomFileName();
            var streetType    = Path.GetRandomFileName();
            var testSubject   =
                new UsStreetPo(new AddressData()
            {
                ThoroughfareNumber = addressNumber,
                PostalCode         = postalCode,
                Locality           = city,
                ThoroughfareName   = streetName,
                RegionAbbrev       = stateAbbrv,
                ThoroughfareType   = streetType
            });

            Assert.IsFalse(testSubject.Equals(null));
            Assert.IsFalse(testSubject.Equals(new UsStreetPo(new AddressData())));

            var testAreEqual = new UsStreetPo(new AddressData()
            {
                ThoroughfareNumber = addressNumber,
                PostalCode         = postalCode,
                Locality           = city,
                ThoroughfareName   = streetName,
                RegionAbbrev       = stateAbbrv,
                ThoroughfareType   = streetType
            });

            Assert.IsTrue(testSubject.Equals(testAreEqual));

            testAreEqual.GetData().ThoroughfareNumber = testAreEqual.GetData().ThoroughfareNumber.ToUpper();

            Assert.IsTrue(testSubject.Equals(testAreEqual));
        }