public void Should_Validate_Against_A_List_Of_Numbers() { ICreditCardNumberCheck sut = SuT; foreach (var entry in NetworkToCreditCardNumberSamples) { Assert.IsTrue(sut.IsValid(entry.Value, entry.Key)); } }
public void Should_Validate_Against_A_List_Of_Numbers_Automatically() { ICreditCardNumberCheck sut = SuT; foreach (var entry in NetworkToCreditCardNumberSamples) { try { Assert.IsTrue(sut.IsValid(entry.Value, CreditCardNetwork.Automatic)); } catch (ArgumentException exc) { throw new ArgumentException(entry.Value, exc); } } }
static CreditCardNumberExtensions() { creditCardNumberCheck = new CreditCardNumberCheck(); }
public void Should_Calculate_A_Digit_With_Visa() { ICreditCardNumberCheck sut = SuT; Assert.AreEqual("6", sut.CalculateCheckDigit("4992739871", CreditCardNetwork.Visa)); }
public void Should_Validate_An_Account_Number_With_Automatic() { ICreditCardNumberCheck sut = SuT; Assert.IsTrue(sut.IsValid("4556-3371-6490-1361", CreditCardNetwork.Automatic)); }
public void Should_Validate_An_Account_Number_With_Non_Digits_With_Method_Visa() { ICreditCardNumberCheck sut = SuT; Assert.IsTrue(sut.IsValid("0499-2739-8710-0006", CreditCardNetwork.Visa)); }
public void Should_Validate_An_Account_Number_With_Method_Visa_To_False() { ICreditCardNumberCheck sut = SuT; Assert.IsFalse(sut.IsValid("0499273987100007", CreditCardNetwork.Visa)); }