From 65990ebf59037d172379f6a3491430daa4aabffc Mon Sep 17 00:00:00 2001 From: MarcinZiabek Date: Fri, 21 Oct 2022 12:05:45 +0200 Subject: [PATCH] Added the WordWrappingStability test --- QuestPDF.Examples/TextExamples.cs | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/QuestPDF.Examples/TextExamples.cs b/QuestPDF.Examples/TextExamples.cs index 905bcb8..a3c0c12 100644 --- a/QuestPDF.Examples/TextExamples.cs +++ b/QuestPDF.Examples/TextExamples.cs @@ -657,5 +657,37 @@ namespace QuestPDF.Examples }); }); } + + [Test] + public void WordWrappingStability() + { + // instruction: check if any characters repeat when performing the word-wrapping algorithm + + RenderingTest + .Create() + .PageSize(PageSizes.A4) + .ProducePdf() + .ShowResults() + .Render(container => + { + var text = "Lorem ipsum dolor sit amet consectetuer"; + + container + .Padding(20) + .Column(column => + { + column.Spacing(10); + + foreach (var width in Enumerable.Range(25, 200)) + { + column + .Item() + .MaxWidth(width) + .Background(Colors.Grey.Lighten3) + .Text(text); + } + }); + }); + } } } \ No newline at end of file