Exemplo n.º 1
0
        public void test_signature_separated_by_dashes_2()
        {
            var msgBody = @"Hey!
-roman";

            Bruteforce.ExtractSignature(msgBody).ShouldBe(new Tuple <string, string>("Hey!", "-roman"));
        }
Exemplo n.º 2
0
        public void test_mailbox_for_iphone_signature()
        {
            var msgBody = @"Blah
Sent from Mailbox for iPhone";

            Bruteforce.ExtractSignature(msgBody)
            .ShouldBe(new Tuple <string, string>("Blah", "Sent from Mailbox for iPhone"));
        }
Exemplo n.º 3
0
        public void test_signature_separated_by_dashes_4()
        {
            var msgBody = @"Wow. Awesome!
--
Bob Smith";

            Bruteforce.ExtractSignature(msgBody).ShouldBe(new Tuple <string, string>("Wow. Awesome!", "--\r\nBob Smith"));
        }
Exemplo n.º 4
0
        public void test_blackberry_signature_2()
        {
            var msgBody = @"Blah
Enviado desde mi oficina móvil BlackBerry® de Telcel";

            Bruteforce.ExtractSignature(msgBody)
            .ShouldBe(new Tuple <string, string>("Blah", "Enviado desde mi oficina móvil BlackBerry® de Telcel"));
        }
Exemplo n.º 5
0
        public void test_iphone_signature()
        {
            var msgBody = @"Hey!

Sent from my iPhone!";

            Bruteforce.ExtractSignature(msgBody).ShouldBe(new Tuple <string, string>("Hey!", "Sent from my iPhone!"));
        }
Exemplo n.º 6
0
        public void test_blank_lines_inside_signature_2()
        {
            var msgBody = @"Blah
--

John Doe";

            Bruteforce.ExtractSignature(msgBody).ShouldBe(new Tuple <string, string>("Blah", "--\r\n\r\nJohn Doe"));
        }
Exemplo n.º 7
0
        public void test_signature_words()
        {
            var msgBody = @"Hey!

Thanks!
Roman";

            Bruteforce.ExtractSignature(msgBody).ShouldBe(new Tuple <string, string>("Hey!", "Thanks!\r\nRoman"));
        }
Exemplo n.º 8
0
        public void test_signature_separated_by_dashes()
        {
            var msgBody = @"Hey man! How r u?
---
Roman";

            Bruteforce.ExtractSignature(msgBody)
            .ShouldBe(new Tuple <string, string>("Hey man! How r u?", "---\r\nRoman"));
        }
Exemplo n.º 9
0
        public void test_blackberry_signature()
        {
            var msgBody = @"Heeyyoooo.
Sent wirelessly from my BlackBerry device on the Bell network.
Envoyé sans fil par mon terminal mobile BlackBerry sur le réseau de Bell.";

            var sig = msgBody.Substring("Heeyyoooo.".Length, msgBody.Length - "Heeyyoooo.".Length);

            Bruteforce.ExtractSignature(msgBody).ShouldBe(new Tuple <string, string>("Heeyyoooo.", sig.Trim()));
        }
Exemplo n.º 10
0
        public void test_blank_lines_inside_signature(string test)
        {
            var msgBody = @"Blah.

" + test + @"

Sent from my HTC smartphone!";

            Bruteforce.ExtractSignature(msgBody)
            .ShouldBe(new Tuple <string, string>("Blah.", test + "\r\n\r\nSent from my HTC smartphone!"));
        }
Exemplo n.º 11
0
        public void test_line_starts_with_signature_word()
        {
            var msgBody = @"Hey man!
Thanks for your attention.
--
Thanks!
Roman";

            Bruteforce.ExtractSignature(msgBody)
            .ShouldBe(new Tuple <string, string>("Hey man!\r\nThanks for your attention.", "--\r\nThanks!\r\nRoman"));
        }
Exemplo n.º 12
0
        public void test_signature_words_3()
        {
            var msgBody = @"Hey!
--
--
Regards,
Roman";

            Bruteforce.ExtractSignature(msgBody)
            .ShouldBe(new Tuple <string, string>("Hey!", "--\r\n--\r\nRegards,\r\nRoman"));
        }
Exemplo n.º 13
0
        public void test_signature_cant_start_from_first_line()
        {
            var msgBody = @"Thanks,

Blah

regards

John Doe";

            Bruteforce.ExtractSignature(msgBody)
            .ShouldBe(new Tuple <string, string>("Thanks,\r\n\r\nBlah", "regards\r\n\r\nJohn Doe"));
        }
Exemplo n.º 14
0
        public void test_line_starts_with_dashes()
        {
            var msgBody = @"Hey man!
Look at this:

--> one
--> two
--
Roman";

            Bruteforce.ExtractSignature(msgBody)
            .ShouldBe(new Tuple <string, string>("Hey man!\r\nLook at this:\r\n\r\n--> one\r\n--> two", "--\r\nRoman"));
        }
Exemplo n.º 15
0
        public void test_signature_max_lines_ignores_empty_lines()
        {
            using (new SignatureMaxLinesScope(2))
            {
                var msgBody = @"Thanks,
Blah

regards


John Doe";
                Bruteforce.ExtractSignature(msgBody)
                .ShouldBe(new Tuple <string, string>("Thanks,\r\nBlah", "regards\r\n\r\n\r\nJohn Doe"));
            }
        }
Exemplo n.º 16
0
 public void test_empty_body()
 {
     Bruteforce.ExtractSignature("").ShouldBe(new Tuple <string, string>("", null));
 }
Exemplo n.º 17
0
        public void test_no_signature()
        {
            var msgBody = "Hey man!";

            Bruteforce.ExtractSignature(msgBody).ShouldBe(new Tuple <string, string>(msgBody, null));
        }
Exemplo n.º 18
0
        public void test_signature_only()
        {
            var msgBody = "--\nRoman";

            Bruteforce.ExtractSignature(msgBody).ShouldBe(new Tuple <string, string>(msgBody, null));
        }