Example #1
0
        public void HashCode()
        {
            var id1 = new ObjectID("Official", 42);
            var id2 = new ObjectID("Official", 42);
            var id3 = new ObjectID("Official", 41);

            Assert.That(id1.GetHashCode() == id2.GetHashCode(), Is.True);
            Assert.That(id1.GetHashCode() == id3.GetHashCode(), Is.False);
            Assert.That(id2.GetHashCode() == id3.GetHashCode(), Is.False);
        }
Example #2
0
        public void DeserializedContent_HashCode()
        {
            ObjectID id             = DomainObjectIDs.Order1;
            ObjectID deserializedID = Serializer.SerializeAndDeserialize(id);

            Assert.That(deserializedID.GetHashCode(), Is.EqualTo(id.GetHashCode()));
        }
Example #3
0
        public override int GetHashCode()
        {
            int hashCode = 13;

            hashCode = (hashCode * 7) + ObjectID.GetHashCode();
            hashCode = (hashCode * 7) + RoleID.GetHashCode();
            return(hashCode);
        }
Example #4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ObjectID.Length != 0)
            {
                hash ^= ObjectID.GetHashCode();
            }
            if (CID.Length != 0)
            {
                hash ^= CID.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        private int CalculateHashCode()
        {
            var propertyName = Definition.PropertyName;

            return((_objectID != null ? _objectID.GetHashCode() : 0) ^ (propertyName != null ? propertyName.GetHashCode() : 0));
        }
        public void HashCode()
        {
            int expectedHashCode = _objectID.GetHashCode() ^ _propertyName.GetHashCode();

            Assert.That(_endPointID.GetHashCode(), Is.EqualTo(expectedHashCode));
        }
Example #7
0
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 /// A hash code for the current <see cref="T:System.Object"/>.
 /// </returns>
 public override int GetHashCode()
 {
     return(ObjectID.GetHashCode());
 }
Example #8
0
 public override int GetHashCode()
 {
     return((OwnerID * 10000).GetHashCode() + ObjectID.GetHashCode());
 }