public void Test_with_period_at_end_of_number() { string text = "This is a body of text containing visa cc 4485230168606183 and 4485230168606191. And the start of a new sentance."; CreditCardDerived ccd = new CreditCardDerived(); Assert.AreEqual(2, ccd.CreditCardNumbersInText(text).Count); }
public void Test_credit_card_email_count_with_hex() { string email = "This is a fake Mastercard number: 5300042628491142\n\nand this is the same number 5300042628491142abcd with four hex characters after it,\n\nand again with abcd5300042628491142 four hex characters before it, \n\nand again with ab5300042628491142cd with two hex before and after it."; CreditCardDerived ccd = new CreditCardDerived(); List <Capture> captureList = ccd.CreditCardNumbersInText(email); Assert.AreEqual(1, captureList.Count); }