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); }