public void First_phone_is_parsed(string html, string expected) { var parser = new ContactDetailsParser(); var result = parser.ParseFirstPhoneNumber(html); Assert.Equal(expected, result); }
public void No_phone_returns_null(string html) { var parser = new ContactDetailsParser(); var result = parser.ParseFirstPhoneNumber(html); Assert.Null(result); }
public void No_email_returns_null(string html) { var parser = new ContactDetailsParser(); var result = parser.ParseFirstEmailAddress(html); Assert.Null(result); }
public void First_email_is_parsed_from_mailto() { var parser = new ContactDetailsParser(); var text = "<p>This text has <a href=\"mailto:[email protected]\">[email protected]</a> in it and [email protected] as well.</p>"; var result = parser.ParseFirstEmailAddress(text); Assert.Equal("*****@*****.**", result); }
public void First_email_is_parsed_from_text() { var parser = new ContactDetailsParser(); var text = "This text has [email protected] in it and [email protected] as well."; var result = parser.ParseFirstEmailAddress(text); Assert.Equal("*****@*****.**", result); }