public int GetHashCode(IXmlIdentity name) { var code = NameComparer.GetHashCode(name.Name.LocalName); if (name.XsiType != XmlName.Empty) { code = (code << 7 | code >> 25) ^ XsiTypeComparer.GetHashCode(name.XsiType); } // DO NOT include NamespaceUri in hash code. // That would break 'null means any' behavior. return(code); }
public void Return_Correct_HashCode_From_Fields() { var name = CreateName(); int expectedHashCode = (byte)name.MutKod ^ name.NmEtiket.GetHashCode() ^ name.NmMemo.GetHashCode() ^ name.NmNaam.GetHashCode() ^ name.NmNm40.GetHashCode() ^ name.NmNr; var comparer = new NameComparer(); int result = comparer.GetHashCode(name); Assert.AreEqual(expectedHashCode, result); }
public override int GetHashCode() { return(NameComparer.GetHashCode(this.UniqueName)); }