/// <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; }
public void Verify_Year_With_Century_Is_Interpreted_Correctly() { var cd = new CardDate(8, 2010); Assert.Equal(2010, cd.Year); }
public void Verify_Year_Below_Threshold_Is_Interpreted_As_This_Century() { var cd = new CardDate(8, 15); Assert.Equal(cd.Year, 2015); }
public void Verify_Year_Below_Threshold_Is_Interpreted_As_Last_Century() { var cd = new CardDate(8, 95); Assert.Equal(1995, cd.Year); }
public void Verify_CardDate_ToString_Works_On_0899() { CardDate cd = new CardDate(8, 1999); Assert.Equal("0899", cd.ToString()); }
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); }