Example #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((ProgramIdentifier.GetHashCode() * 397) ^ LineNumber);
     }
 }
        public void ProgramIdentifier_GetHashcode_ProducesCorrectHash()
        {
            var dataPart   = 0x123u;
            var otherPart  = 0x456u;
            var identifier = new ProgramIdentifier(dataPart, otherPart);

            var combinedParts = (((ulong)dataPart) << 32) | otherPart;
            var expectedHash  = combinedParts.GetHashCode();

            Assert.Equal(expectedHash, identifier.GetHashCode());
        }