Exemple #1
0
        [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);
        }
Exemple #2
0
        [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);
        }
Exemple #3
0
        [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);
        }
Exemple #4
0
        [Test] public void TestFormatFlowed()
        {
            MailBodyParser parser = CreateParser("This is a test \r\nmessage");

            AssertEquals("This is a test message", parser.GetParagraph(0).Text);
        }
Exemple #5
0
 private void VerifyPara(int index, string body, ParagraphType type)
 {
     Assert.AreEqual(body, _parser.GetParagraph(index).Text);
     Assert.AreEqual(type, _parser.GetParagraph(index).Type);
 }
Exemple #6
0
        [Test] public void TestLongQuotePrefix()
        {
            MailBodyParser parser = CreateParser("----------------> ");

            Assert.AreEqual(0, parser.GetParagraph(0).QuoteLevel);
        }