예제 #1
0
        public void TestMixedPlainAndFormattedText(string formattedText, string plainText)
        {
            Paragraph paragraph = document.LastSection.AddParagraph();

            paragraph.AddFormattedText(formattedText);
            paragraph.AddText(plainText);
            Assert.AreEqual($"{formattedText}{plainText}", paragraph.GetRawText());
        }
예제 #2
0
        public void TestParagraphWithLinebreaks()
        {
            Paragraph paragraph = document.LastSection.AddParagraph();
            string    text0     = "before line break";
            string    text1     = "\n";
            string    text2     = "afterlinebreak";

            paragraph.AddText(text0);
            paragraph.AddText(text1);
            paragraph.AddText(text2);

            string expected = $"{text0}{text1}{text2}";

            Assert.AreEqual(expected, paragraph.GetRawText());
        }