Пример #1
0
 public void UpdateAddress(string address)
 {
     if (!StreetAddress.Equals(address) && !string.IsNullOrEmpty(address))
     {
         StreetAddress = address;
     }
 }
Пример #2
0
        public void DiffAptNoEqualsTest()
        {
            var target = new StreetAddress("1;1894;beacon st;brookline;ma;usa;02445");
            var obj    = new StreetAddress(";1894;beacon st;brookline;ma;usa;02445");

            Assert.IsFalse(target.Equals(obj));
            Assert.IsFalse(obj.Equals(target));
        }
Пример #3
0
        public void StreetAddress_Equals_Same_Ref_Returns_True()
        {
            var target = new StreetAddress("1;1894;beacon st;brookline;ma;usa;02445");
            var other  = target;

            Assert.IsTrue(target.Equals(other));
            Assert.IsTrue(other.Equals(target));
        }
Пример #4
0
        public void StreetAddress_Equals_Non_StreetAddress_Returns_False()
        {
            var target = new StreetAddress("1;1894;beacon st;brookline;ma;usa;02445");

            // ReSharper disable SuspiciousTypeConversion.Global
            Assert.IsFalse(target.Equals(0));
            // ReSharper restore SuspiciousTypeConversion.Global
        }
Пример #5
0
        public void AllSameEqualsTest()
        {
            const string address = "1;1894;beacon st;brookline;ma;usa;02445";

            var target = new StreetAddress(address);
            var obj    = new StreetAddress(address);

            Assert.IsTrue(target.Equals(obj));
            Assert.IsTrue(obj.Equals(target));
        }
Пример #6
0
        public void StreetAddress_Equals_Null_Returns_False()
        {
            var target = new StreetAddress("1;1894;beacon st;brookline;ma;usa;02445");

            Assert.IsFalse(target.Equals(null));
        }