Beispiel #1
0
        public void GetHashCodeIsSameForEqualObjects()
        {
            var a = new CardType("V");
            var b = new CardType("V");

            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            int hashCode = -842337720;

            hashCode = hashCode * -1521134295 + type.GetHashCode();
            hashCode = hashCode * -1521134295 + index.GetHashCode();
            return(hashCode);
        }
Beispiel #3
0
        public static int GetHashCode(CardType cardType, CardValue cardValue, byte series)
        {
            unchecked {
                int _hash = 17;
                _hash = _hash * 23 + cardType.GetHashCode();
                _hash = _hash * 23 + cardValue.GetHashCode();
                _hash = _hash * 23 + series.GetHashCode();

                return(_hash);
            }
        }
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (CardNumber == null ? 0 : CardNumber.GetHashCode());
         hash = hash * 23 + (CardType == null ? 0 : CardType.GetHashCode());
         hash = hash * 23 + (ExpMonth == default(byte) ? 0 : ExpMonth.GetHashCode());
         hash = hash * 23 + (ExpYear == default(short) ? 0 : ExpYear.GetHashCode());
         hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode());
         return(hash);
     }
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (CardType != 0)
            {
                hash ^= CardType.GetHashCode();
            }
            if (CardId != 0)
            {
                hash ^= CardId.GetHashCode();
            }
            if (InteractionType != 0)
            {
                hash ^= InteractionType.GetHashCode();
            }
            if (InteractionSelect != 0)
            {
                hash ^= InteractionSelect.GetHashCode();
            }
            return(hash);
        }
Beispiel #6
0
        public override int GetHashCode()
        {
            unchecked
            {
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ (!Object.ReferenceEquals(null, CardType) ? CardType.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^ (!Object.ReferenceEquals(null, CardColor) ? CardColor.GetHashCode() : 0);

                return(hash);
            }
        }
Beispiel #7
0
        public override int GetHashCode()
        {
            int hashCode = 1370361237;

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (CardBrand != null)
            {
                hashCode += CardBrand.GetHashCode();
            }

            if (Last4 != null)
            {
                hashCode += Last4.GetHashCode();
            }

            if (ExpMonth != null)
            {
                hashCode += ExpMonth.GetHashCode();
            }

            if (ExpYear != null)
            {
                hashCode += ExpYear.GetHashCode();
            }

            if (CardholderName != null)
            {
                hashCode += CardholderName.GetHashCode();
            }

            if (BillingAddress != null)
            {
                hashCode += BillingAddress.GetHashCode();
            }

            if (Fingerprint != null)
            {
                hashCode += Fingerprint.GetHashCode();
            }

            if (CardType != null)
            {
                hashCode += CardType.GetHashCode();
            }

            if (PrepaidType != null)
            {
                hashCode += PrepaidType.GetHashCode();
            }

            if (Bin != null)
            {
                hashCode += Bin.GetHashCode();
            }

            return(hashCode);
        }
Beispiel #8
0
 public override int GetHashCode()
 {
     return(Cost.GetHashCode() ^ CardType.GetHashCode());
 }