コード例 #1
0
        public void Hashcode_Ignores_Whitespace()
        {
            var lhs = new Iban("BE71 0961 2345 6769");
            var rhs = new Iban("BE 71 096123456769");

            lhs.GetHashCode().Equals(rhs.GetHashCode()).Should().BeTrue();
        }
コード例 #2
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 (AdditionalAddressInfo != null)
         {
             hashCode = hashCode * 59 + AdditionalAddressInfo.GetHashCode();
         }
         if (City != null)
         {
             hashCode = hashCode * 59 + City.GetHashCode();
         }
         if (CountryCode != null)
         {
             hashCode = hashCode * 59 + CountryCode.GetHashCode();
         }
         if (HouseNumber != null)
         {
             hashCode = hashCode * 59 + HouseNumber.GetHashCode();
         }
         if (Iban != null)
         {
             hashCode = hashCode * 59 + Iban.GetHashCode();
         }
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (ReferenceParty != null)
         {
             hashCode = hashCode * 59 + ReferenceParty.GetHashCode();
         }
         if (ReferencePartyId != null)
         {
             hashCode = hashCode * 59 + ReferencePartyId.GetHashCode();
         }
         if (Street != null)
         {
             hashCode = hashCode * 59 + Street.GetHashCode();
         }
         if (Zip != null)
         {
             hashCode = hashCode * 59 + Zip.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ ClientId.GetHashCode();
         hashCode = (hashCode * 397) ^ Iban.GetHashCode();
         hashCode = (hashCode * 397) ^ Currency.GetHashCode();
         hashCode = (hashCode * 397) ^ CreatedByEmployee.GetHashCode();
         return(hashCode);
     }
 }
コード例 #4
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 (BoletoBancarioRequiredness != null)
         {
             hashCode = hashCode * 59 + BoletoBancarioRequiredness.GetHashCode();
         }
         if (EmailAddress != null)
         {
             hashCode = hashCode * 59 + EmailAddress.GetHashCode();
         }
         if (ExpirationDate != null)
         {
             hashCode = hashCode * 59 + ExpirationDate.GetHashCode();
         }
         if (FixedList != null)
         {
             hashCode = hashCode * 59 + FixedList.GetHashCode();
         }
         if (Iban != null)
         {
             hashCode = hashCode * 59 + Iban.GetHashCode();
         }
         if (Length != null)
         {
             hashCode = hashCode * 59 + Length.GetHashCode();
         }
         if (Luhn != null)
         {
             hashCode = hashCode * 59 + Luhn.GetHashCode();
         }
         if (Range != null)
         {
             hashCode = hashCode * 59 + Range.GetHashCode();
         }
         if (RegularExpression != null)
         {
             hashCode = hashCode * 59 + RegularExpression.GetHashCode();
         }
         if (TermsAndConditions != null)
         {
             hashCode = hashCode * 59 + TermsAndConditions.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #5
0
ファイル: BankInfo.cs プロジェクト: LedgerLocal/LedgerLocal
 /// <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 (Nickname != null)
         {
             hashCode = hashCode * 59 + Nickname.GetHashCode();
         }
         if (CurrencyId != null)
         {
             hashCode = hashCode * 59 + CurrencyId.GetHashCode();
         }
         if (AccountHolder != null)
         {
             hashCode = hashCode * 59 + AccountHolder.GetHashCode();
         }
         if (AccountNumber != null)
         {
             hashCode = hashCode * 59 + AccountNumber.GetHashCode();
         }
         if (Iban != null)
         {
             hashCode = hashCode * 59 + Iban.GetHashCode();
         }
         if (BankName != null)
         {
             hashCode = hashCode * 59 + BankName.GetHashCode();
         }
         if (SortCode != null)
         {
             hashCode = hashCode * 59 + SortCode.GetHashCode();
         }
         if (RoutingNumber != null)
         {
             hashCode = hashCode * 59 + RoutingNumber.GetHashCode();
         }
         if (SwiftBic != null)
         {
             hashCode = hashCode * 59 + SwiftBic.GetHashCode();
         }
         if (IfscCode != null)
         {
             hashCode = hashCode * 59 + IfscCode.GetHashCode();
         }
         if (RoutingCode != null)
         {
             hashCode = hashCode * 59 + RoutingCode.GetHashCode();
         }
         if (UserAddressId != null)
         {
             hashCode = hashCode * 59 + UserAddressId.GetHashCode();
         }
         if (BankAddress != null)
         {
             hashCode = hashCode * 59 + BankAddress.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #6
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Firstname.Length != 0)
            {
                hash ^= Firstname.GetHashCode();
            }
            if (Lastname.Length != 0)
            {
                hash ^= Lastname.GetHashCode();
            }
            if (Email.Length != 0)
            {
                hash ^= Email.GetHashCode();
            }
            if (City.Length != 0)
            {
                hash ^= City.GetHashCode();
            }
            if (Iban.Length != 0)
            {
                hash ^= Iban.GetHashCode();
            }
            if (Time.Length != 0)
            {
                hash ^= Time.GetHashCode();
            }
            if (Title.Length != 0)
            {
                hash ^= Title.GetHashCode();
            }
            if (Shirtsize.Length != 0)
            {
                hash ^= Shirtsize.GetHashCode();
            }
            if (PostalCode != 0)
            {
                hash ^= PostalCode.GetHashCode();
            }
            if (MacAdress.Length != 0)
            {
                hash ^= MacAdress.GetHashCode();
            }
            if (Latitude != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Latitude);
            }
            if (JobTitle.Length != 0)
            {
                hash ^= JobTitle.GetHashCode();
            }
            if (Currency.Length != 0)
            {
                hash ^= Currency.GetHashCode();
            }
            if (Country.Length != 0)
            {
                hash ^= Country.GetHashCode();
            }
            if (CountryCode.Length != 0)
            {
                hash ^= CountryCode.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }