public void TestMixedPlainAndFormattedText(string formattedText, string plainText) { Paragraph paragraph = document.LastSection.AddParagraph(); paragraph.AddFormattedText(formattedText); paragraph.AddText(plainText); Assert.AreEqual($"{formattedText}{plainText}", paragraph.GetRawText()); }
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()); }