예제 #1
0
        public void Equality_Ignores_Whitespace()
        {
            var lhs = new Iban("BE71 0961 2345 6769");
            var rhs = new Iban("BE 71 096123456769");

            lhs.Equals(rhs).Should().BeTrue();
            (lhs == rhs).Should().BeTrue();
            (lhs != rhs).Should().BeFalse();
        }
예제 #2
0
        /// <summary>
        /// Synchronous method to validate an given iban code.
        /// </summary>
        /// <param name="sIban">The given i ban code as string, which should be validated.</param>
        /// <returns>'True' if iban code is valid, otherwise 'false'.</returns>
        public bool ValidateIban(string sIban)
        {
            //  convert string to object
            Iban iban = this.ConvertStringToIban(sIban);

            //  generate iban and compare to given iban
            IbanBic generated = this.GenerateIban(iban.Country.CountryType, iban.Bank.BankIdentification, iban.AccountNumber);

            if (iban.Equals(generated.IBAN))
            {
                return(true);
            }

            return(false);
        }
예제 #3
0
        /// <summary>
        /// Returns true if BankInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of BankInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Nickname == other.Nickname ||
                     Nickname != null &&
                     Nickname.Equals(other.Nickname)
                     ) &&
                 (
                     CurrencyId == other.CurrencyId ||
                     CurrencyId != null &&
                     CurrencyId.Equals(other.CurrencyId)
                 ) &&
                 (
                     AccountHolder == other.AccountHolder ||
                     AccountHolder != null &&
                     AccountHolder.Equals(other.AccountHolder)
                 ) &&
                 (
                     AccountNumber == other.AccountNumber ||
                     AccountNumber != null &&
                     AccountNumber.Equals(other.AccountNumber)
                 ) &&
                 (
                     Iban == other.Iban ||
                     Iban != null &&
                     Iban.Equals(other.Iban)
                 ) &&
                 (
                     BankName == other.BankName ||
                     BankName != null &&
                     BankName.Equals(other.BankName)
                 ) &&
                 (
                     SortCode == other.SortCode ||
                     SortCode != null &&
                     SortCode.Equals(other.SortCode)
                 ) &&
                 (
                     RoutingNumber == other.RoutingNumber ||
                     RoutingNumber != null &&
                     RoutingNumber.Equals(other.RoutingNumber)
                 ) &&
                 (
                     SwiftBic == other.SwiftBic ||
                     SwiftBic != null &&
                     SwiftBic.Equals(other.SwiftBic)
                 ) &&
                 (
                     IfscCode == other.IfscCode ||
                     IfscCode != null &&
                     IfscCode.Equals(other.IfscCode)
                 ) &&
                 (
                     RoutingCode == other.RoutingCode ||
                     RoutingCode != null &&
                     RoutingCode.Equals(other.RoutingCode)
                 ) &&
                 (
                     UserAddressId == other.UserAddressId ||
                     UserAddressId != null &&
                     UserAddressId.Equals(other.UserAddressId)
                 ) &&
                 (
                     BankAddress == other.BankAddress ||
                     BankAddress != null &&
                     BankAddress.Equals(other.BankAddress)
                 ));
        }
        /// <summary>
        /// Returns true if Creditor instances are equal
        /// </summary>
        /// <param name="other">Instance of Creditor to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Creditor other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AdditionalAddressInfo == other.AdditionalAddressInfo ||
                     AdditionalAddressInfo != null &&
                     AdditionalAddressInfo.Equals(other.AdditionalAddressInfo)
                     ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     CountryCode == other.CountryCode ||
                     CountryCode != null &&
                     CountryCode.Equals(other.CountryCode)
                 ) &&
                 (
                     HouseNumber == other.HouseNumber ||
                     HouseNumber != null &&
                     HouseNumber.Equals(other.HouseNumber)
                 ) &&
                 (
                     Iban == other.Iban ||
                     Iban != null &&
                     Iban.Equals(other.Iban)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     ReferenceParty == other.ReferenceParty ||
                     ReferenceParty != null &&
                     ReferenceParty.Equals(other.ReferenceParty)
                 ) &&
                 (
                     ReferencePartyId == other.ReferencePartyId ||
                     ReferencePartyId != null &&
                     ReferencePartyId.Equals(other.ReferencePartyId)
                 ) &&
                 (
                     Street == other.Street ||
                     Street != null &&
                     Street.Equals(other.Street)
                 ) &&
                 (
                     Zip == other.Zip ||
                     Zip != null &&
                     Zip.Equals(other.Zip)
                 ));
        }
예제 #5
0
        /// <summary>
        /// Returns true if PaymentProductFieldValidators instances are equal
        /// </summary>
        /// <param name="other">Instance of PaymentProductFieldValidators to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PaymentProductFieldValidators other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BoletoBancarioRequiredness == other.BoletoBancarioRequiredness ||
                     BoletoBancarioRequiredness != null &&
                     BoletoBancarioRequiredness.Equals(other.BoletoBancarioRequiredness)
                     ) &&
                 (
                     EmailAddress == other.EmailAddress ||
                     EmailAddress != null &&
                     EmailAddress.Equals(other.EmailAddress)
                 ) &&
                 (
                     ExpirationDate == other.ExpirationDate ||
                     ExpirationDate != null &&
                     ExpirationDate.Equals(other.ExpirationDate)
                 ) &&
                 (
                     FixedList == other.FixedList ||
                     FixedList != null &&
                     FixedList.Equals(other.FixedList)
                 ) &&
                 (
                     Iban == other.Iban ||
                     Iban != null &&
                     Iban.Equals(other.Iban)
                 ) &&
                 (
                     Length == other.Length ||
                     Length != null &&
                     Length.Equals(other.Length)
                 ) &&
                 (
                     Luhn == other.Luhn ||
                     Luhn != null &&
                     Luhn.Equals(other.Luhn)
                 ) &&
                 (
                     Range == other.Range ||
                     Range != null &&
                     Range.Equals(other.Range)
                 ) &&
                 (
                     RegularExpression == other.RegularExpression ||
                     RegularExpression != null &&
                     RegularExpression.Equals(other.RegularExpression)
                 ) &&
                 (
                     TermsAndConditions == other.TermsAndConditions ||
                     TermsAndConditions != null &&
                     TermsAndConditions.Equals(other.TermsAndConditions)
                 ));
        }