public void testNotEquals_DiffLength() { const string sa = "7b6e8067abcd"; const string sb = "7b6e8067"; AbbreviatedObjectId a = AbbreviatedObjectId.FromString(sa); AbbreviatedObjectId b = AbbreviatedObjectId.FromString(sb); Assert.IsFalse(a.Equals(b)); Assert.IsFalse(b.Equals(a)); }
public void testEquals_Full() { const string s = "7b6e8067ec96acef9a4184b43210d583b6d2f99a"; AbbreviatedObjectId a = AbbreviatedObjectId.FromString(s); AbbreviatedObjectId b = AbbreviatedObjectId.FromString(s); Assert.AreNotSame(a, b); Assert.IsTrue(a.GetHashCode() == b.GetHashCode()); Assert.IsTrue(a.Equals(b)); Assert.IsTrue(b.Equals(a)); }
public void testEquals_Short() { const string s = "7b6e8067"; AbbreviatedObjectId a = AbbreviatedObjectId.FromString(s); AbbreviatedObjectId b = AbbreviatedObjectId.FromString(s); Assert.AreNotSame(a, b); Assert.IsTrue(a.GetHashCode() == b.GetHashCode()); Assert.IsTrue(a.Equals(b)); Assert.IsTrue(b.Equals(a)); }