public void test_preprocess_1() { var msg = "Hello\n" + "See <http://google.com\n" + "> for more\n" + "information On Nov 30, 2011, at 12:47 PM, Somebody <\n" + "416ffd3258d4d2fa4c85cfa4c44e1721d66e3e8f4\n" + "@example.com>" + "wrote:\n" + "\n" + "> Hi"; // test the link is rewritten // "On <date> <person> wrote:" pattern starts from a new line var prepared_msg = "Hello\n" + "See @@http://google.com\n" + "@@ for more\n" + "information\n" + " On Nov 30, 2011, at 12:47 PM, Somebody <\n" + "416ffd3258d4d2fa4c85cfa4c44e1721d66e3e8f4\n" + "@example.com>" + "wrote:\n" + "\n" + "> Hi"; Quotations.Preprocess(msg, "\n").ShouldBe(prepared_msg); }
public void test_preprocess_2() { var msg = @" > <http://teemcl.mailgun.org/u/**aD1mZmZiNGU5ODQwMDNkZWZlMTExNm** > MxNjQ4Y2RmOTNlMCZyPXNlcmdleS5v**YnlraG92JTQwbWFpbGd1bmhxLmNvbS** > Z0PSUyQSZkPWUwY2U<http://example.org/u/aD1mZmZiNGU5ODQwMDNkZWZlMTExNmMxNjQ4Y> "; Quotations.Preprocess(msg, "\n").ShouldBe(msg); }
public void test_preprocess_4() { var msg = "Hello On Nov 30, smb wrote:\n" + "Hi\n" + "On Nov 29, smb wrote:\n" + "hi"; var prepared_msg = "Hello\n" + " On Nov 30, smb wrote:\n" + "Hi\n" + "On Nov 29, smb wrote:\n" + "hi"; Quotations.Preprocess(msg, "\n").ShouldBe(prepared_msg); }
public void test_preprocess_3() { // "On <date> <person> wrote" shouldn"t be spread across too many lines var msg = "Hello\n" + "How are you? On Nov 30, 2011, at 12:47 PM,\n " + "Example <\n" + "416ffd3258d4d2fa4c85cfa4c44e1721d66e3e8f4\n" + "@example.org>" + "wrote:\n" + "\n" + "> Hi"; var msgAfterSplit = "Hello\n" + "How are you?\n" + " On Nov 30, 2011, at 12:47 PM,\n " + "Example <\n" + "416ffd3258d4d2fa4c85cfa4c44e1721d66e3e8f4\n" + "@example.org>" + "wrote:\n" + "\n" + "> Hi"; Quotations.Preprocess(msg, "\n").ShouldBe(msg); }