GitSharp.Core.Diff.Edit.Equals C# (CSharp) Method

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
        public override bool Equals(object obj)
        {
            Edit e = (obj as Edit);
            if (e != null)
            {
                return BeginA == e.BeginA && EndA == e.EndA && BeginB == e.BeginB && EndB == e.EndB;
            }

            return false;
        }

Usage Example

コード例 #1
0
ファイル: EditTest.cs プロジェクト: jagregory/GitSharp
        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(""));
        }