コード例 #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" });
        }
コード例 #2
0
        public void test_get_signature_candidate_2()
        {
            // first line never included
            var lines = new[] { "text", "signature" };

            Bruteforce.GetSignatureCandidate(lines).ShouldBe(new[] { "signature" });
        }
コード例 #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();
     }
 }
コード例 #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" });
     }
 }
コード例 #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" });
     }
 }
コード例 #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" });
     }
 }