示例#1
0
        /// <summary>
        /// Compares two addresses for equality.
        /// </summary>
        /// <param name="Address">An address to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(Address Address)
        {
            if (Address is null)
            {
                return(false);
            }

            return(Country.Equals(Address.Country) &&
                   City.Equals(Address.City) &&
                   Street.Equals(Address.Street) &&

                   ((PostalCode == null && Address.PostalCode == null) ||
                    (PostalCode != null && Address.PostalCode != null && PostalCode.Equals(Address.PostalCode))) &&

                   ((HouseNumber == null && Address.HouseNumber == null) ||
                    (HouseNumber != null && Address.HouseNumber != null && HouseNumber.Equals(Address.HouseNumber))) &&

                   ((FloorLevel == null && Address.FloorLevel == null) ||
                    (FloorLevel != null && Address.FloorLevel != null && FloorLevel.Equals(Address.FloorLevel))) &&

                   ((Region == null && Address.Region == null) ||
                    (Region != null && Address.Region != null && Region.Equals(Address.Region))) &&

                   ((Timezone == null && Address.Timezone == null) ||
                    (Timezone != null && Address.Timezone != null && Timezone.Equals(Address.Timezone))));
        }
示例#2
0
        /// <summary>
        /// Returns true if Address instances are equal
        /// </summary>
        /// <param name="other">Instance of Address to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Address other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     AdditionalInfo.Equals(other.AdditionalInfo)
                     ) &&
                 (
                     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)
                 ) &&
                 (
                     State == other.State ||
                     State != null &&
                     State.Equals(other.State)
                 ) &&
                 (
                     StateCode == other.StateCode ||
                     StateCode != null &&
                     StateCode.Equals(other.StateCode)
                 ) &&
                 (
                     Street == other.Street ||
                     Street != null &&
                     Street.Equals(other.Street)
                 ) &&
                 (
                     Zip == other.Zip ||
                     Zip != null &&
                     Zip.Equals(other.Zip)
                 ));
        }
示例#3
0
 public override bool Equals(object obj)
 {
     if (obj is UserPrivacyInfo)
     {
         var upi = (UserPrivacyInfo)obj;
         return
             (LastName.Equals(upi.LastName) &&
              DateOfBirth.Equals(upi.DateOfBirth) &&
              HouseAddress.Equals(upi.HouseAddress) &&
              HouseNumber.Equals(upi.HouseNumber) &&
              PostCode.Equals(upi.PostCode) &&
              City.Equals(upi.City) &&
              Country.Equals(upi.Country) &&
              PhoneNumber.Equals(upi.PhoneNumber));
     }
     return(false);
 }
示例#4
0
        /// <summary>
        /// Compares two addresses for equality.
        /// </summary>
        /// <param name="Address">An address to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(Address Address)
        {
            if ((Object)Address == null)
            {
                return(false);
            }

            try
            {
                return(Street.Equals(Address.Street) &&
                       HouseNumber.Equals(Address.HouseNumber) &&
                       FloorLevel.Equals(Address.FloorLevel) &&
                       PostalCode.Equals(Address.PostalCode) &&
                       PostalCodeSub.Equals(Address.PostalCodeSub) &&
                       City.Equals(Address.City) &&
                       Country.Equals(Address.Country));
            }
            catch (Exception e)
            {
                return(false);
            }
        }
示例#5
0
        public bool Equals(IAccount other)
        {
            if (!AccountID.Equals(other.AccountID))
            {
                Error.AddMessage("Account " + UID + " AccountID: " + AccountID + " is not equal to other: " + other.AccountID);
                return(false);
            }

            if (!BirthCountry.Equals(other.BirthCountry))
            {
                Error.AddMessage("Account " + UID + " BirthCountry: " + BirthCountry + " is not equal to other: " + other.BirthCountry);
                return(false);
            }

            if (!Birthday.Equals(other.Birthday))
            {
                Error.AddMessage("Account " + UID + " Birthday: " + Birthday + " is not equal to other: " + other.Birthday);
                return(false);
            }

            if (!BirthPlace.Equals(other.BirthPlace))
            {
                Error.AddMessage("Account " + UID + " BirthPlace: " + BirthPlace + " is not equal to other: " + other.BirthPlace);
                return(false);
            }

            if (!City.Equals(other.City))
            {
                Error.AddMessage("Account " + UID + " City: " + City + " is not equal to other: " + other.City);
                return(false);
            }

            if (!Country.Equals(other.Country))
            {
                Error.AddMessage("Account " + UID + " Country: " + Country + " is not equal to other: " + other.Country);
                return(false);
            }

            if (!ExtraNames.Equals(other.ExtraNames))
            {
                Error.AddMessage("Account " + UID + " ExtraNames: " + ExtraNames + " is not equal to other: " + other.ExtraNames);
                return(false);
            }

            if (!Fax.Equals(other.Fax))
            {
                Error.AddMessage("Account " + UID + " Fax: " + Fax + " is not equal to other: " + other.Fax);
                return(false);
            }

            if (!Gender.Equals(other.Gender))
            {
                Error.AddMessage("Account " + UID + " Gender: " + Gender + " is not equal to other: " + other.Gender);
                return(false);
            }

            if (!GivenName.Equals(other.GivenName))
            {
                Error.AddMessage("Account " + UID + " GivenName: " + GivenName + " is not equal to other: " + other.GivenName);
                return(false);
            }

            if (!Group.Equals(other.Group))
            {
                Error.AddMessage("Account " + UID + " Group: " + Group + " is not equal to other: " + other.Group);
                return(false);
            }

            if (!HomePhone.Equals(other.HomePhone))
            {
                Error.AddMessage("Account " + UID + " HomePhone: " + HomePhone + " is not equal to other: " + other.HomePhone);
                return(false);
            }

            if (!HouseNumber.Equals(other.HouseNumber))
            {
                Error.AddMessage("Account " + UID + " HouseNumber: " + HouseNumber + " is not equal to other: " + other.HouseNumber);
                return(false);
            }

            if (!HouseNumberAdd.Equals(other.HouseNumberAdd))
            {
                Error.AddMessage("Account " + UID + " HouseNumberAdd: " + HouseNumberAdd + " is not equal to other: " + other.HouseNumberAdd);
                return(false);
            }

            if (!Initials.Equals(other.Initials))
            {
                Error.AddMessage("Account " + UID + " Initials: " + Initials + " is not equal to other: " + other.Initials);
                return(false);
            }

            if (!Mail.Equals(other.Mail))
            {
                Error.AddMessage("Account " + UID + " Mail: " + Mail + " is not equal to other: " + other.Mail);
                return(false);
            }

            if (!MailAlias.Equals(other.MailAlias))
            {
                Error.AddMessage("Account " + UID + " MailAlias: " + MailAlias + " is not equal to other: " + other.MailAlias);
                return(false);
            }

            if (!MobilePhone.Equals(other.MobilePhone))
            {
                Error.AddMessage("Account " + UID + " MobilePhone: " + MobilePhone + " is not equal to other: " + other.MobilePhone);
                return(false);
            }

            if (!PostalCode.Equals(other.PostalCode))
            {
                Error.AddMessage("Account " + UID + " PostalCode: " + PostalCode + " is not equal to other: " + other.PostalCode);
                return(false);
            }

            if (!RegisterID.Equals(other.RegisterID))
            {
                Error.AddMessage("Account " + UID + " RegisterID: " + RegisterID + " is not equal to other: " + other.RegisterID);
                return(false);
            }

            if (!Role.Equals(other.Role))
            {
                Error.AddMessage("Account " + UID + " Role: " + Role + " is not equal to other: " + other.Role);
                return(false);
            }

            if (!StemID.Equals(other.StemID))
            {
                Error.AddMessage("Account " + UID + " StemID: " + StemID + " is not equal to other: " + other.StemID);
                return(false);
            }

            if (!Street.Equals(other.Street))
            {
                Error.AddMessage("Account " + UID + " Street: " + Street + " is not equal to other: " + other.Street);
                return(false);
            }

            if (!SurName.Equals(other.SurName))
            {
                Error.AddMessage("Account " + UID + " SurName: " + SurName + " is not equal to other: " + other.SurName);
                return(false);
            }

            if (!UID.Equals(other.UID))
            {
                Error.AddMessage("Account " + UID + " UID: " + UID + " is not equal to other: " + other.UID);
                return(false);
            }

            if (!UntisID.Equals(other.UntisID))
            {
                Error.AddMessage("Account " + UID + " UntisID: " + UntisID + " is not equal to other: " + other.UntisID);
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Returns true if Debtor instances are equal
        /// </summary>
        /// <param name="other">Instance of Debtor to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Debtor 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)
                 ) &&
                 (
                     FirstName == other.FirstName ||
                     FirstName != null &&
                     FirstName.Equals(other.FirstName)
                 ) &&
                 (
                     HouseNumber == other.HouseNumber ||
                     HouseNumber != null &&
                     HouseNumber.Equals(other.HouseNumber)
                 ) &&
                 (
                     State == other.State ||
                     State != null &&
                     State.Equals(other.State)
                 ) &&
                 (
                     StateCode == other.StateCode ||
                     StateCode != null &&
                     StateCode.Equals(other.StateCode)
                 ) &&
                 (
                     Street == other.Street ||
                     Street != null &&
                     Street.Equals(other.Street)
                 ) &&
                 (
                     Surname == other.Surname ||
                     Surname != null &&
                     Surname.Equals(other.Surname)
                 ) &&
                 (
                     SurnamePrefix == other.SurnamePrefix ||
                     SurnamePrefix != null &&
                     SurnamePrefix.Equals(other.SurnamePrefix)
                 ) &&
                 (
                     Zip == other.Zip ||
                     Zip != null &&
                     Zip.Equals(other.Zip)
                 ));
        }
        /// <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)
                 ));
        }
示例#8
0
        /// <summary>
        /// Returns true if ResponseGeocodingProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ResponseGeocodingProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ResponseGeocodingProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Label == other.Label ||
                     Label != null &&
                     Label.Equals(other.Label)
                 ) &&
                 (
                     Score == other.Score ||

                     Score.Equals(other.Score)
                 ) &&
                 (
                     HouseNumber == other.HouseNumber ||
                     HouseNumber != null &&
                     HouseNumber.Equals(other.HouseNumber)
                 ) &&
                 (
                     Street == other.Street ||
                     Street != null &&
                     Street.Equals(other.Street)
                 ) &&
                 (
                     Region == other.Region ||
                     Region != null &&
                     Region.Equals(other.Region)
                 ) &&
                 (
                     RegionCode == other.RegionCode ||
                     RegionCode != null &&
                     RegionCode.Equals(other.RegionCode)
                 ) &&
                 (
                     Neighbourhood == other.Neighbourhood ||
                     Neighbourhood != null &&
                     Neighbourhood.Equals(other.Neighbourhood)
                 ) &&
                 (
                     County == other.County ||
                     County != null &&
                     County.Equals(other.County)
                 ) &&
                 (
                     Macroregion == other.Macroregion ||
                     Macroregion != null &&
                     Macroregion.Equals(other.Macroregion)
                 ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     Country == other.Country ||
                     Country != null &&
                     Country.Equals(other.Country)
                 ) &&
                 (
                     CountryCode == other.CountryCode ||
                     CountryCode != null &&
                     CountryCode.Equals(other.CountryCode)
                 ) &&
                 (
                     Continent == other.Continent ||
                     Continent != null &&
                     Continent.Equals(other.Continent)
                 ) &&
                 (
                     Postcode == other.Postcode ||
                     Postcode != null &&
                     Postcode.Equals(other.Postcode)
                 ) &&
                 (
                     Features == other.Features ||
                     Features != null &&
                     Features.Equals(other.Features)
                 ));
        }
示例#9
0
 public void Equals_TestStructTestStruct_IsTrue()
 {
     Assert.IsTrue(TestStruct.Equals(TestStruct));
 }