Ejemplo n.º 1
0
        public void test_get_signature_candidate_6()
        {
            // test list (with dashes as bullet points) not included
            var lines = new[] { "List:,", "- item 1", "- item 2", "--", "Bob" };

            Bruteforce.GetSignatureCandidate(lines).ShouldBe(new[] { "--", "Bob" });
        }
Ejemplo n.º 2
0
        public void test_get_signature_candidate_2()
        {
            // first line never included
            var lines = new[] { "text", "signature" };

            Bruteforce.GetSignatureCandidate(lines).ShouldBe(new[] { "signature" });
        }
Ejemplo n.º 3
0
 public void test_get_signature_candidate()
 {
     // if there aren"t at least 2 non-empty lines there should be no signature
     foreach (var lines in new[] { new string[] { }, new[] { "" }, new[] { "", "" }, new[] { "abc" } })
     {
         Bruteforce.GetSignatureCandidate(lines).ShouldBeEmpty();
     }
 }
Ejemplo n.º 4
0
 public void test_get_signature_candidate_5()
 {
     // test long lines not encluded
     using (new TooLongSignatureLineScope(3))
     {
         var lines = new[] { "BR,", "long", "Bob" };
         Bruteforce.GetSignatureCandidate(lines).ShouldBe(new[] { "Bob" });
     }
 }
Ejemplo n.º 5
0
 public void test_get_signature_candidate_4()
 {
     // test when message is longer then the SIGNATURE_MAX_LINES
     using (new SignatureMaxLinesScope(2))
     {
         var lines = new[] { "text1", "text2", "signature1", "", "signature2" };
         Bruteforce.GetSignatureCandidate(lines).ShouldBe(new[] { "signature1", "", "signature2" });
     }
 }
Ejemplo n.º 6
0
 public void test_get_signature_candidate_3()
 {
     // test when message is shorter then SIGNATURE_MAX_LINES
     using (new SignatureMaxLinesScope(3))
     {
         var lines = new[] { "text", "", "", "signature" };
         Bruteforce.GetSignatureCandidate(lines).ShouldBe(new[] { "signature" });
     }
 }