public void UpdateAddress(string address) { if (!StreetAddress.Equals(address) && !string.IsNullOrEmpty(address)) { StreetAddress = address; } }
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)); }
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)); }
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 }
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)); }
public void StreetAddress_Equals_Null_Returns_False() { var target = new StreetAddress("1;1894;beacon st;brookline;ma;usa;02445"); Assert.IsFalse(target.Equals(null)); }