Exemplo n.º 1
0
        public void First_phone_is_parsed(string html, string expected)
        {
            var parser = new ContactDetailsParser();

            var result = parser.ParseFirstPhoneNumber(html);

            Assert.Equal(expected, result);
        }
Exemplo n.º 2
0
        public void No_phone_returns_null(string html)
        {
            var parser = new ContactDetailsParser();

            var result = parser.ParseFirstPhoneNumber(html);

            Assert.Null(result);
        }
Exemplo n.º 3
0
        public void No_email_returns_null(string html)
        {
            var parser = new ContactDetailsParser();

            var result = parser.ParseFirstEmailAddress(html);

            Assert.Null(result);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }