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

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     CurrencyCode == other.CurrencyCode ||
                     CurrencyCode != null &&
                     CurrencyCode.Equals(other.CurrencyCode)
                 ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     CVC == other.CVC ||
                     CVC != null &&
                     CVC.Equals(other.CVC)
                 ) &&
                 (
                     CardNumber == other.CardNumber ||
                     CardNumber != null &&
                     CardNumber.Equals(other.CardNumber)
                 ) &&
                 (
                     FullName == other.FullName ||
                     FullName != null &&
                     FullName.Equals(other.FullName)
                 ) &&
                 (
                     CardExpiryDate == other.CardExpiryDate ||
                     CardExpiryDate != null &&
                     CardExpiryDate.Equals(other.CardExpiryDate)
                 ) &&
                 (
                     RequestDate == other.RequestDate ||
                     RequestDate != null &&
                     RequestDate.Equals(other.RequestDate)
                 ));
        }
Ejemplo n.º 2
0
        public override int FaceValue(CardNumber cardNumber)
        {
            int value = 0;

            if ((int)cardNumber > 9)
            {
                value = 10;
            }
            else if (cardNumber.Equals(CardNumber.Ace))
            {
                value = 11;
            }
            else
            {
                value = (int)cardNumber;
            }
            return(value);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns true if CardEssentials instances are equal
        /// </summary>
        /// <param name="other">Instance of CardEssentials to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CardEssentials other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CardNumber == other.CardNumber ||
                     CardNumber != null &&
                     CardNumber.Equals(other.CardNumber)
                     ) &&
                 (
                     ExpiryDate == other.ExpiryDate ||
                     ExpiryDate != null &&
                     ExpiryDate.Equals(other.ExpiryDate)
                 ));
        }
Ejemplo n.º 4
0
        public void CardNumber_TwoInstancesWithTheSameCardNumber_ShouldEqual()
        {
            var secondCardNumber = new CardNumber(CardNumber);

            sut.Equals(secondCardNumber).Should().BeTrue();
        }