Example #1
0
        public void No_email_returns_null(string html)
        {
            var parser = new ContactDetailsParser();

            var result = parser.ParseFirstEmailAddress(html);

            Assert.Null(result);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }