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" }); }
public void test_get_signature_candidate_2() { // first line never included var lines = new[] { "text", "signature" }; Bruteforce.GetSignatureCandidate(lines).ShouldBe(new[] { "signature" }); }
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(); } }
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" }); } }
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" }); } }
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" }); } }