Equals() public method

Determines whether the specified T:System.Object is equal to the current T:System.Object.
/// The parameter is null. ///
public Equals ( object obj ) : bool
obj object The to compare with /// the current . ///
return bool
Exemplo n.º 1
0
        public void testEquals1()
        {
            Edit e1 = new Edit(1, 2, 3, 4);
            Edit e2 = new Edit(1, 2, 3, 4);

            Assert.IsTrue(e1.Equals(e1));
            Assert.IsTrue(e1.Equals(e2));
            Assert.IsTrue(e2.Equals(e1));
            Assert.AreEqual(e1.GetHashCode(), e2.GetHashCode());
            Assert.IsFalse(e1.Equals(""));
        }