Represents the month/year date format used to encode payment card start dates and expiry dates.
Esempio n. 1
0
 /// <summary>
 ///   Initialize a new instance of <see cref = "PaymentCard" /> based on the supplied values.
 /// </summary>
 /// <param name = "cardHolder">The full cardholder name, as it appears on the payment card.</param>
 /// <param name = "cardNumber">The PAN number - the long number across the front of the card</param>
 /// <param name = "expiryDate">The card expiry date</param>
 /// <param name = "cv2">The Card Verification Value or 'signature digits' from the payment card.</param>
 /// <param name = "cardType"></param>
 public PaymentCard(string cardHolder, string cardNumber, CardDate expiryDate, string cv2, CardType cardType)
 {
     this.CardHolder = cardHolder;
     this.CardNumber = cardNumber;
     this.ExpiryDate = expiryDate;
     this.CV2 = cv2;
     this.CardType = cardType;
 }
Esempio n. 2
0
 public void Verify_Year_With_Century_Is_Interpreted_Correctly()
 {
     var cd = new CardDate(8, 2010);
     Assert.Equal(2010, cd.Year);
 }
Esempio n. 3
0
 public void Verify_Year_Below_Threshold_Is_Interpreted_As_This_Century()
 {
     var cd = new CardDate(8, 15);
     Assert.Equal(cd.Year, 2015);
 }
Esempio n. 4
0
 public void Verify_Year_Below_Threshold_Is_Interpreted_As_Last_Century()
 {
     var cd = new CardDate(8, 95);
     Assert.Equal(1995, cd.Year);
 }
Esempio n. 5
0
 public void Verify_CardDate_ToString_Works_On_0899()
 {
     CardDate cd = new CardDate(8, 1999);
     Assert.Equal("0899", cd.ToString());
 }
Esempio n. 6
0
 public void Verify_CardDate_Constructed_From_Int_Int_Is_Correct()
 {
     var cd = new CardDate(5, 8);
     Assert.Equal("05", cd.TwoDigitMonth);
     Assert.Equal("08", cd.TwoDigitYear);
 }