Exemplo n.º 1
0
        public void Equals_ReturnsExpectedResult(Postcode left, object right, bool expectedResult)
        {
            // Arrange

            // Act
            var result = left.Equals(right);

            // Assert
            result.Should().Equals(expectedResult);
        }
        /// <summary>
        /// Returns true if CommonSimpleAddress instances are equal
        /// </summary>
        /// <param name="other">Instance of CommonSimpleAddress to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CommonSimpleAddress other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     MailingName == other.MailingName ||
                     MailingName != null &&
                     MailingName.Equals(other.MailingName)
                     ) &&
                 (
                     AddressLine1 == other.AddressLine1 ||
                     AddressLine1 != null &&
                     AddressLine1.Equals(other.AddressLine1)
                 ) &&
                 (
                     AddressLine2 == other.AddressLine2 ||
                     AddressLine2 != null &&
                     AddressLine2.Equals(other.AddressLine2)
                 ) &&
                 (
                     AddressLine3 == other.AddressLine3 ||
                     AddressLine3 != null &&
                     AddressLine3.Equals(other.AddressLine3)
                 ) &&
                 (
                     Postcode == other.Postcode ||
                     Postcode != null &&
                     Postcode.Equals(other.Postcode)
                 ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     State == other.State ||
                     State != null &&
                     State.Equals(other.State)
                 ) &&
                 (
                     Country == other.Country ||
                     Country != null &&
                     Country.Equals(other.Country)
                 ));
        }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            var otherAddress = obj as Address;

            if (otherAddress == null || Address1 == null)
            {
                return(false);
            }

            if (!Address1.Equals(otherAddress.Address1))
            {
                return(false);
            }
            if (Address2 != null)
            {
                if (!Address2.Equals(otherAddress.Address2))
                {
                    return(false);
                }
            }
            if (Suburb != null)
            {
                if (!Suburb.Equals(otherAddress.Suburb))
                {
                    return(false);
                }
            }
            if (Postcode != null)
            {
                if (!Postcode.Equals(otherAddress.Postcode))
                {
                    return(false);
                }
            }
            if (State != null)
            {
                if (!State.Equals(otherAddress.State))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Returns true if CommonPAFAddress instances are equal
        /// </summary>
        /// <param name="other">Instance of CommonPAFAddress to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CommonPAFAddress other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Dpid == other.Dpid ||
                     Dpid != null &&
                     Dpid.Equals(other.Dpid)
                     ) &&
                 (
                     ThoroughfareNumber1 == other.ThoroughfareNumber1 ||
                     ThoroughfareNumber1 != null &&
                     ThoroughfareNumber1.Equals(other.ThoroughfareNumber1)
                 ) &&
                 (
                     ThoroughfareNumber1Suffix == other.ThoroughfareNumber1Suffix ||
                     ThoroughfareNumber1Suffix != null &&
                     ThoroughfareNumber1Suffix.Equals(other.ThoroughfareNumber1Suffix)
                 ) &&
                 (
                     ThoroughfareNumber2 == other.ThoroughfareNumber2 ||
                     ThoroughfareNumber2 != null &&
                     ThoroughfareNumber2.Equals(other.ThoroughfareNumber2)
                 ) &&
                 (
                     ThoroughfareNumber2Suffix == other.ThoroughfareNumber2Suffix ||
                     ThoroughfareNumber2Suffix != null &&
                     ThoroughfareNumber2Suffix.Equals(other.ThoroughfareNumber2Suffix)
                 ) &&
                 (
                     FlatUnitNumber == other.FlatUnitNumber ||
                     FlatUnitNumber != null &&
                     FlatUnitNumber.Equals(other.FlatUnitNumber)
                 ) &&
                 (
                     FloorLevelNumber == other.FloorLevelNumber ||
                     FloorLevelNumber != null &&
                     FloorLevelNumber.Equals(other.FloorLevelNumber)
                 ) &&
                 (
                     LotNumber == other.LotNumber ||
                     LotNumber != null &&
                     LotNumber.Equals(other.LotNumber)
                 ) &&
                 (
                     BuildingName1 == other.BuildingName1 ||
                     BuildingName1 != null &&
                     BuildingName1.Equals(other.BuildingName1)
                 ) &&
                 (
                     BuildingName2 == other.BuildingName2 ||
                     BuildingName2 != null &&
                     BuildingName2.Equals(other.BuildingName2)
                 ) &&
                 (
                     StreetName == other.StreetName ||
                     StreetName != null &&
                     StreetName.Equals(other.StreetName)
                 ) &&
                 (
                     StreetType == other.StreetType ||
                     StreetType != null &&
                     StreetType.Equals(other.StreetType)
                 ) &&
                 (
                     StreetSuffix == other.StreetSuffix ||
                     StreetSuffix != null &&
                     StreetSuffix.Equals(other.StreetSuffix)
                 ) &&
                 (
                     PostalDeliveryType == other.PostalDeliveryType ||
                     PostalDeliveryType != null &&
                     PostalDeliveryType.Equals(other.PostalDeliveryType)
                 ) &&
                 (
                     PostalDeliveryNumber == other.PostalDeliveryNumber ||
                     PostalDeliveryNumber != null &&
                     PostalDeliveryNumber.Equals(other.PostalDeliveryNumber)
                 ) &&
                 (
                     PostalDeliveryNumberPrefix == other.PostalDeliveryNumberPrefix ||
                     PostalDeliveryNumberPrefix != null &&
                     PostalDeliveryNumberPrefix.Equals(other.PostalDeliveryNumberPrefix)
                 ) &&
                 (
                     PostalDeliveryNumberSuffix == other.PostalDeliveryNumberSuffix ||
                     PostalDeliveryNumberSuffix != null &&
                     PostalDeliveryNumberSuffix.Equals(other.PostalDeliveryNumberSuffix)
                 ) &&
                 (
                     LocalityName == other.LocalityName ||
                     LocalityName != null &&
                     LocalityName.Equals(other.LocalityName)
                 ) &&
                 (
                     Postcode == other.Postcode ||
                     Postcode != null &&
                     Postcode.Equals(other.Postcode)
                 ) &&
                 (
                     State == other.State ||
                     State != null &&
                     State.Equals(other.State)
                 ));
        }
Exemplo n.º 5
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)
                 ));
        }
        /// <summary>
        /// Returns true if Verblijfsadres instances are equal
        /// </summary>
        /// <param name="other">Instance of Verblijfsadres to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Verblijfsadres other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     PeriodeGeldigheid == other.PeriodeGeldigheid ||
                     PeriodeGeldigheid != null &&
                     PeriodeGeldigheid.Equals(other.PeriodeGeldigheid)
                     ) &&
                 (
                     IdentificatieNummerAanduiding == other.IdentificatieNummerAanduiding ||
                     IdentificatieNummerAanduiding != null &&
                     IdentificatieNummerAanduiding.Equals(other.IdentificatieNummerAanduiding)
                 ) &&
                 (
                     Postcode == other.Postcode ||
                     Postcode != null &&
                     Postcode.Equals(other.Postcode)
                 ) &&
                 (
                     Huisnummer == other.Huisnummer ||
                     Huisnummer != null &&
                     Huisnummer.Equals(other.Huisnummer)
                 ) &&
                 (
                     Huisletter == other.Huisletter ||
                     Huisletter != null &&
                     Huisletter.Equals(other.Huisletter)
                 ) &&
                 (
                     Huisnummertoevoeging == other.Huisnummertoevoeging ||
                     Huisnummertoevoeging != null &&
                     Huisnummertoevoeging.Equals(other.Huisnummertoevoeging)
                 ) &&
                 (
                     Locatiebeschrijving == other.Locatiebeschrijving ||
                     Locatiebeschrijving != null &&
                     Locatiebeschrijving.Equals(other.Locatiebeschrijving)
                 ) &&
                 (
                     NaamOpenbareRuimte == other.NaamOpenbareRuimte ||
                     NaamOpenbareRuimte != null &&
                     NaamOpenbareRuimte.Equals(other.NaamOpenbareRuimte)
                 ) &&
                 (
                     Woonplaatsnaam == other.Woonplaatsnaam ||
                     Woonplaatsnaam != null &&
                     Woonplaatsnaam.Equals(other.Woonplaatsnaam)
                 ) &&
                 (
                     WoonplaatsIdentificatie == other.WoonplaatsIdentificatie ||
                     WoonplaatsIdentificatie != null &&
                     WoonplaatsIdentificatie.Equals(other.WoonplaatsIdentificatie)
                 ));
        }