public void TestLineBreaksAreHandled() { var paragraph = new Paragraph("I wandered lonely as a cloud\r\n" + "That floats on high o'er vales and hills,\r\n" + "When all at once I saw a crowd,\r\n" + "A host, of golden daffodils;\r\n" + "Beside the lake, beneath the trees,\r\n" + "Fluttering and dancing in the breeze."); paragraph.AssertOutputEquals( "I wandered lonely as a cloud \r\n" + "That floats on high o'er vales and hills, \r\n" + "When all at once I saw a crowd, \r\n" + "A host, of golden daffodils; \r\n" + "Beside the lake, beneath the trees, \r\n" + "Fluttering and dancing in the breeze.\r\n" , "<p>I wandered lonely as a cloud<br />\n" + "That floats on high o'er vales and hills,<br />\n" + "When all at once I saw a crowd,<br />\n" + "A host, of golden daffodils;<br />\n" + "Beside the lake, beneath the trees,<br />\n" + "Fluttering and dancing in the breeze.</p>\n"); }
public void TestWrappingColumnCanBeSpecified() { var paragraph = new Paragraph("Most people die of a sort of creeping common sense, and discover when it is too late that the only things one never regrets are one's mistakes.") { WordWrapColumn = 20 }; paragraph.WriteToTrace(); }
public void TestWrappingCanBeDisabled() { var paragraph = new Paragraph("Whoever fights monsters should see to it that in the process he does not become a monster. And if you gaze long enough into an abyss, the abyss will gaze back into you.") { WordWrap = false }; paragraph.WriteToTrace(); }
public void TestDifferentTypesOfLineBreaksAreHandled() { var paragraph = new Paragraph("Unix style:\n" + "ZX Spectrum style:\r" + "Acorn BBC Spooled output:\n\r" + "Windows style:\r\n"); paragraph.AssertOutputEquals( "Unix style: \r\n" + "ZX Spectrum style: \r\n" + "Acorn BBC Spooled output: \r\n" + "Windows style:\r\n" , "<p>Unix style:<br />\n" + "ZX Spectrum style:<br />\n" + "Acorn BBC Spooled output:<br />\n" + "Windows style:</p>\n"); }
public void TestParagraphsCanBeUsed() { var paragraph = new Paragraph("The quick brown fox jumps over the lazy dog."); paragraph.WriteToTrace(); }
public void TestLongParagraphsAreWrapped() { var paragraph = new Paragraph("Lolita, light of my life, fire of my loins. My sin, my soul. Lo-lee-ta: the tip of the tongue taking a trip of three steps down the palate to tap, at three, on the teeth. Lo. Lee. Ta."); paragraph.WriteToTrace(); }
public void ParagraphWithCustomWordWrapColumn() { var text = "Most people die of a sort of creeping common sense, and discover when it is too late that the only things one never regrets are one's mistakes."; var paragraph = new Paragraph(text) { WordWrapColumn = 30 }; Console.Write(paragraph); }