[Test] public void TestWhitespaceLines() { MailBodyParser parser = CreateParser("This is a test\n \t\nmessage"); Assert.AreEqual(2, parser.ParagraphCount); Assert.AreEqual("This is a test", parser.GetParagraph(0).Text); Assert.AreEqual("message", parser.GetParagraph(1).Text); }
[Test] public void TestQuoting() { MailBodyParser parser = CreateParser("> Quoted text"); VerifyPara(0, "Quoted text", ParagraphType.Plain); Assert.AreEqual(1, parser.GetParagraph(0).QuoteLevel); Assert.AreEqual("", parser.GetParagraph(0).QuotePrefix); }
[Test] public void BasicTest() { MailBodyParser parser = CreateParser("This is a test message"); Assert.AreEqual(1, parser.ParagraphCount); MailBodyParser.Paragraph para = parser.GetParagraph(0); Assert.IsNotNull(para); Assert.AreEqual("This is a test message", para.Text); Assert.AreEqual(ParagraphType.Plain, para.Type); }
[Test] public void TestFormatFlowed() { MailBodyParser parser = CreateParser("This is a test \r\nmessage"); AssertEquals("This is a test message", parser.GetParagraph(0).Text); }
private void VerifyPara(int index, string body, ParagraphType type) { Assert.AreEqual(body, _parser.GetParagraph(index).Text); Assert.AreEqual(type, _parser.GetParagraph(index).Type); }
[Test] public void TestLongQuotePrefix() { MailBodyParser parser = CreateParser("----------------> "); Assert.AreEqual(0, parser.GetParagraph(0).QuoteLevel); }