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

            return
                ((
                     AdditionalData == other.AdditionalData ||
                     AdditionalData != null &&
                     AdditionalData.Equals(other.AdditionalData)
                     ) &&
                 (
                     InvoiceDate == other.InvoiceDate ||
                     InvoiceDate != null &&
                     InvoiceDate.Equals(other.InvoiceDate)
                 ) &&
                 (
                     InvoiceNumber == other.InvoiceNumber ||
                     InvoiceNumber != null &&
                     InvoiceNumber.Equals(other.InvoiceNumber)
                 ) &&
                 (
                     TextQualifiers == other.TextQualifiers ||
                     TextQualifiers != null &&
                     TextQualifiers.SequenceEqual(other.TextQualifiers)
                 ));
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is Invoice other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((Version == null && other.Version == null) || (Version?.Equals(other.Version) == true)) &&
                   ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) &&
                   ((OrderId == null && other.OrderId == null) || (OrderId?.Equals(other.OrderId) == true)) &&
                   ((PrimaryRecipient == null && other.PrimaryRecipient == null) || (PrimaryRecipient?.Equals(other.PrimaryRecipient) == true)) &&
                   ((PaymentRequests == null && other.PaymentRequests == null) || (PaymentRequests?.Equals(other.PaymentRequests) == true)) &&
                   ((DeliveryMethod == null && other.DeliveryMethod == null) || (DeliveryMethod?.Equals(other.DeliveryMethod) == true)) &&
                   ((InvoiceNumber == null && other.InvoiceNumber == null) || (InvoiceNumber?.Equals(other.InvoiceNumber) == true)) &&
                   ((Title == null && other.Title == null) || (Title?.Equals(other.Title) == true)) &&
                   ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) &&
                   ((ScheduledAt == null && other.ScheduledAt == null) || (ScheduledAt?.Equals(other.ScheduledAt) == true)) &&
                   ((PublicUrl == null && other.PublicUrl == null) || (PublicUrl?.Equals(other.PublicUrl) == true)) &&
                   ((NextPaymentAmountMoney == null && other.NextPaymentAmountMoney == null) || (NextPaymentAmountMoney?.Equals(other.NextPaymentAmountMoney) == true)) &&
                   ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) &&
                   ((Timezone == null && other.Timezone == null) || (Timezone?.Equals(other.Timezone) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)) &&
                   ((CustomFields == null && other.CustomFields == null) || (CustomFields?.Equals(other.CustomFields) == true)));
        }
예제 #3
0
        /// <summary>
        /// Returns true if Seller instances are equal
        /// </summary>
        /// <param name="other">Instance of Seller to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Seller other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Address == other.Address ||
                     Address != null &&
                     Address.Equals(other.Address)
                     ) &&
                 (
                     ChannelCode == other.ChannelCode ||
                     ChannelCode != null &&
                     ChannelCode.Equals(other.ChannelCode)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Geocode == other.Geocode ||
                     Geocode != null &&
                     Geocode.Equals(other.Geocode)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     InvoiceNumber == other.InvoiceNumber ||
                     InvoiceNumber != null &&
                     InvoiceNumber.Equals(other.InvoiceNumber)
                 ) &&
                 (
                     Mcc == other.Mcc ||
                     Mcc != null &&
                     Mcc.Equals(other.Mcc)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ));
        }
        public void Will_Return_True_For_Same_FormattedNumber()
        {
            var formattedNumber = Guid.NewGuid().ToString();
            var number1         = new InvoiceNumber(1, 2, 3, 4, formattedNumber);
            var number2         = new InvoiceNumber(2, 3, 4, 5, formattedNumber);

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

            return
                ((
                     AgentNumericCode == other.AgentNumericCode ||
                     AgentNumericCode != null &&
                     AgentNumericCode.Equals(other.AgentNumericCode)
                     ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ) &&
                 (
                     FlightDate == other.FlightDate ||
                     FlightDate != null &&
                     FlightDate.Equals(other.FlightDate)
                 ) &&
                 (
                     FlightLegs == other.FlightLegs ||
                     FlightLegs != null &&
                     FlightLegs.SequenceEqual(other.FlightLegs)
                 ) &&
                 (
                     InvoiceNumber == other.InvoiceNumber ||
                     InvoiceNumber != null &&
                     InvoiceNumber.Equals(other.InvoiceNumber)
                 ) &&
                 (
                     IsETicket == other.IsETicket ||
                     IsETicket != null &&
                     IsETicket.Equals(other.IsETicket)
                 ) &&
                 (
                     IsRegisteredCustomer == other.IsRegisteredCustomer ||
                     IsRegisteredCustomer != null &&
                     IsRegisteredCustomer.Equals(other.IsRegisteredCustomer)
                 ) &&
                 (
                     IsRestrictedTicket == other.IsRestrictedTicket ||
                     IsRestrictedTicket != null &&
                     IsRestrictedTicket.Equals(other.IsRestrictedTicket)
                 ) &&
                 (
                     IsThirdParty == other.IsThirdParty ||
                     IsThirdParty != null &&
                     IsThirdParty.Equals(other.IsThirdParty)
                 ) &&
                 (
                     IssueDate == other.IssueDate ||
                     IssueDate != null &&
                     IssueDate.Equals(other.IssueDate)
                 ) &&
                 (
                     MerchantCustomerId == other.MerchantCustomerId ||
                     MerchantCustomerId != null &&
                     MerchantCustomerId.Equals(other.MerchantCustomerId)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     PassengerName == other.PassengerName ||
                     PassengerName != null &&
                     PassengerName.Equals(other.PassengerName)
                 ) &&
                 (
                     Passengers == other.Passengers ||
                     Passengers != null &&
                     Passengers.SequenceEqual(other.Passengers)
                 ) &&
                 (
                     PlaceOfIssue == other.PlaceOfIssue ||
                     PlaceOfIssue != null &&
                     PlaceOfIssue.Equals(other.PlaceOfIssue)
                 ) &&
                 (
                     Pnr == other.Pnr ||
                     Pnr != null &&
                     Pnr.Equals(other.Pnr)
                 ) &&
                 (
                     PointOfSale == other.PointOfSale ||
                     PointOfSale != null &&
                     PointOfSale.Equals(other.PointOfSale)
                 ) &&
                 (
                     PosCityCode == other.PosCityCode ||
                     PosCityCode != null &&
                     PosCityCode.Equals(other.PosCityCode)
                 ) &&
                 (
                     TicketDeliveryMethod == other.TicketDeliveryMethod ||
                     TicketDeliveryMethod != null &&
                     TicketDeliveryMethod.Equals(other.TicketDeliveryMethod)
                 ) &&
                 (
                     TicketNumber == other.TicketNumber ||
                     TicketNumber != null &&
                     TicketNumber.Equals(other.TicketNumber)
                 ) &&
                 (
                     TotalFare == other.TotalFare ||
                     TotalFare != null &&
                     TotalFare.Equals(other.TotalFare)
                 ) &&
                 (
                     TotalFee == other.TotalFee ||
                     TotalFee != null &&
                     TotalFee.Equals(other.TotalFee)
                 ) &&
                 (
                     TotalTaxes == other.TotalTaxes ||
                     TotalTaxes != null &&
                     TotalTaxes.Equals(other.TotalTaxes)
                 ) &&
                 (
                     TravelAgencyName == other.TravelAgencyName ||
                     TravelAgencyName != null &&
                     TravelAgencyName.Equals(other.TravelAgencyName)
                 ));
        }