public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.type)
            {
                hashcode = (hashcode * 397) + Type.GetHashCode();
            }
            if (__isset.luid)
            {
                hashcode = (hashcode * 397) + Luid.GetHashCode();
            }
            if (__isset.phones)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(Phones);
            }
            if (__isset.emails)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(Emails);
            }
            if (__isset.userids)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(Userids);
            }
        }
        return(hashcode);
    }
Exemple #2
0
        public void GetHashCodeTestForMaxValueReturned()
        {
            int expected = int.MaxValue;

            Luid target = new Luid(int.MaxValue, int.MaxValue);

            int actual = target.GetHashCode();

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void GetHashCodeTest()
        {
            var expected = 200;

            var target = new Luid(100, 100);

            var actual = target.GetHashCode();

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        public void GetHashCodeTest()
        {
            int expected = 200;

            Luid target = new Luid(100, 100);

            int actual = target.GetHashCode();

            Assert.AreEqual(expected, actual);
        }
Exemple #5
0
        /// <summary>Returns a hash code for this <see cref="ModeInfo"/> structure.</summary>
        /// <returns>Returns a hash code for this <see cref="ModeInfo"/> structure.</returns>
        public override int GetHashCode()
        {
            var value = (int)InfoType ^ Id ^ AdapterId.GetHashCode();

            if (InfoType == ModeInfoType.Source)
            {
                value ^= sourceMode.GetHashCode();
            }
            else if (InfoType == ModeInfoType.Target)
            {
                value ^= targetMode.GetHashCode();
            }

            return(value);
        }
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.contact)
            {
                hashcode = (hashcode * 397) + Contact.GetHashCode();
            }
            if (__isset.luid)
            {
                hashcode = (hashcode * 397) + Luid.GetHashCode();
            }
            if (__isset.contactType)
            {
                hashcode = (hashcode * 397) + ContactType.GetHashCode();
            }
            if (__isset.contactKey)
            {
                hashcode = (hashcode * 397) + ContactKey.GetHashCode();
            }
        }
        return(hashcode);
    }
Exemple #7
0
        public void ReturnsTheHashCodeAsExpected()
        {
            var target = new Luid(1, 2);

            Assert.AreEqual(3, target.GetHashCode());
        }
Exemple #8
0
        public void GetHashCodeTestForMaxValueReturned()
        {
            int expected = int.MaxValue;

            Luid target = new Luid(int.MaxValue, int.MaxValue);

            int actual = target.GetHashCode();

            Assert.AreEqual(expected, actual);
        }
Exemple #9
0
        public void GetHashCodeTest()
        {
            int expected = 200;

            Luid target = new Luid(100, 100);

            int actual = target.GetHashCode();

            Assert.AreEqual(expected, actual);
        }