public void Value_Equality() { var a0 = new MultiAddress(somewhere); var a1 = new MultiAddress(somewhere); var b = new MultiAddress(nowhere); MultiAddress c = null; MultiAddress d = null; Assert.True(c == d); Assert.False(c == b); Assert.False(b == c); Assert.False(c != d); Assert.True(c != b); Assert.True(b != c); #pragma warning disable 1718 Assert.True(a0 == a0); Assert.True(a0 == a1); Assert.False(a0 == b); #pragma warning disable 1718 Assert.False(a0 != a0); Assert.False(a0 != a1); Assert.True(a0 != b); Assert.True(a0.Equals(a0)); Assert.True(a0.Equals(a1)); Assert.False(a0.Equals(b)); Assert.Equal(a0, a0); Assert.Equal(a0, a1); Assert.NotEqual(a0, b); Assert.Equal(a0, a0); Assert.Equal(a0, a1); Assert.NotEqual(a0, b); Assert.Equal(a0.GetHashCode(), a0.GetHashCode()); Assert.Equal(a0.GetHashCode(), a1.GetHashCode()); Assert.NotEqual(a0.GetHashCode(), b.GetHashCode()); }
public void Value_Equality() { var a0 = new MultiAddress(somewhere); var a1 = new MultiAddress(somewhere); var b = new MultiAddress(nowhere); MultiAddress c = null; MultiAddress d = null; Assert.IsTrue(c == d); Assert.IsFalse(c == b); Assert.IsFalse(b == c); Assert.IsFalse(c != d); Assert.IsTrue(c != b); Assert.IsTrue(b != c); #pragma warning disable 1718 Assert.IsTrue(a0 == a0); Assert.IsTrue(a0 == a1); Assert.IsFalse(a0 == b); #pragma warning disable 1718 Assert.IsFalse(a0 != a0); Assert.IsFalse(a0 != a1); Assert.IsTrue(a0 != b); Assert.IsTrue(a0.Equals(a0)); Assert.IsTrue(a0.Equals(a1)); Assert.IsFalse(a0.Equals(b)); Assert.AreEqual(a0, a0); Assert.AreEqual(a0, a1); Assert.AreNotEqual(a0, b); Assert.AreEqual<MultiAddress>(a0, a0); Assert.AreEqual<MultiAddress>(a0, a1); Assert.AreNotEqual<MultiAddress>(a0, b); Assert.AreEqual(a0.GetHashCode(), a0.GetHashCode()); Assert.AreEqual(a0.GetHashCode(), a1.GetHashCode()); Assert.AreNotEqual(a0.GetHashCode(), b.GetHashCode()); }