示例#1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (OwnerID.Length != 0)
            {
                hash ^= OwnerID.GetHashCode();
            }
            if (Salt.Length != 0)
            {
                hash ^= Salt.GetHashCode();
            }
            if (Capacity != 0UL)
            {
                hash ^= Capacity.GetHashCode();
            }
            if (rules_ != null)
            {
                hash ^= Rules.GetHashCode();
            }
            if (BasicACL != 0)
            {
                hash ^= BasicACL.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#2
0
        public override int GetHashCode()
        {
            // Auto-generated by Visual Studio

            var hashCode = -871570897;

            hashCode = hashCode * -1521134295 + EqualityComparer <byte[]> .Default.GetHashCode(_buffer);

            hashCode = hashCode * -1521134295 + _isOpen.GetHashCode();
            hashCode = hashCode * -1521134295 + _readOnly.GetHashCode();
            hashCode = hashCode * -1521134295 + _length.GetHashCode();
            hashCode = hashCode * -1521134295 + _capacity.GetHashCode();
            hashCode = hashCode * -1521134295 + _position.GetHashCode();
            hashCode = hashCode * -1521134295 + _startIndex.GetHashCode();
            hashCode = hashCode * -1521134295 + _isExpandable.GetHashCode();
            hashCode = hashCode * -1521134295 + IsReadOnly.GetHashCode();
            hashCode = hashCode * -1521134295 + IsOpen.GetHashCode();
            hashCode = hashCode * -1521134295 + Length.GetHashCode();
            hashCode = hashCode * -1521134295 + Capacity.GetHashCode();
            hashCode = hashCode * -1521134295 + Position.GetHashCode();
            hashCode = hashCode * -1521134295 + RemainingBytes.GetHashCode();
            hashCode = hashCode * -1521134295 + StartIndex.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <byte[]> .Default.GetHashCode(Raw);

            return(hashCode);
        }
示例#3
0
        public void GetHashCodeReturnsCorrectResult([Frozen] Guid[] ids, Capacity sut)
        {
            var expectedHashCode = ids
                                   .Select(g => g.GetHashCode())
                                   .Aggregate((x, y) => x ^ y)
                                   ^ sut.Remaining.GetHashCode();

            Assert.Equal(expectedHashCode, sut.GetHashCode());
        }
示例#4
0
        /// <summary>
        /// Getter for room's hashcode.
        /// </summary>
        /// <returns>hashCode</returns>
        public override int GetHashCode()
        {
            var hashCode = 1430268434;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(RoomName);

            hashCode = hashCode * -1521134295 + Capacity.GetHashCode();
            return(hashCode);
        }
示例#5
0
 public int GetHashCodeWithMembers()
 {
     unchecked
     {
         var hashCode = 397;
         hashCode = (hashCode * 397) ^ Capacity.GetHashCode();
         hashCode = (hashCode * 397) ^ ((int)Type).GetHashCode();
         hashCode = (hashCode * 397) ^ Ghz.GetHashCode();
         hashCode = (hashCode * 397) ^ (BankLabel?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (DeviceLocator?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Generation.GetHashCode();
         return(hashCode);
     }
 }
示例#6
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Metadata != null)
         {
             hashCode = hashCode * 59 + Metadata.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Capacity != null)
         {
             hashCode = hashCode * 59 + Capacity.GetHashCode();
         }
         if (Peoplecount != null)
         {
             hashCode = hashCode * 59 + Peoplecount.GetHashCode();
         }
         if (BoundingPolygon != null)
         {
             hashCode = hashCode * 59 + BoundingPolygon.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#7
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (TypeId != null)
         {
             hashCode = hashCode * 59 + TypeId.GetHashCode();
         }
         if (Profile != null)
         {
             hashCode = hashCode * 59 + Profile.GetHashCode();
         }
         if (Capacity != null)
         {
             hashCode = hashCode * 59 + Capacity.GetHashCode();
         }
         if (SpeedFactor != null)
         {
             hashCode = hashCode * 59 + SpeedFactor.GetHashCode();
         }
         if (ServiceTimeFactor != null)
         {
             hashCode = hashCode * 59 + ServiceTimeFactor.GetHashCode();
         }
         if (CostPerMeter != null)
         {
             hashCode = hashCode * 59 + CostPerMeter.GetHashCode();
         }
         if (CostPerSecond != null)
         {
             hashCode = hashCode * 59 + CostPerSecond.GetHashCode();
         }
         if (CostPerActivation != null)
         {
             hashCode = hashCode * 59 + CostPerActivation.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#8
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Capacity != 0)
            {
                hash ^= Capacity.GetHashCode();
            }
            if (Count != 0)
            {
                hash ^= Count.GetHashCode();
            }
            if (item_ != null)
            {
                hash ^= Item.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#9
0
 public void GetHashCodeReturnsCorrectResult([Frozen]Guid[] ids, Capacity sut)
 {
     var expectedHashCode = ids.Select(g => g.GetHashCode()).Aggregate((x, y) => x ^ y) ^ sut.Remaining.GetHashCode();
     Assert.Equal(expectedHashCode, sut.GetHashCode());
 }