diff --git a/QuestPDF.Examples/DebuggingTesting.cs b/QuestPDF.Examples/DebuggingTesting.cs index fb78bad..cecaa95 100644 --- a/QuestPDF.Examples/DebuggingTesting.cs +++ b/QuestPDF.Examples/DebuggingTesting.cs @@ -1,4 +1,5 @@ using NUnit.Framework; +using QuestPDF.Drawing.Exceptions; using QuestPDF.Examples.Engine; using QuestPDF.Fluent; using QuestPDF.Helpers; @@ -10,54 +11,66 @@ namespace QuestPDF.Examples [Test] public void Stack() { - RenderingTest - .Create() - .PageSize(500, 360) - .Render(container => - { - container - .Padding(10) - .Width(100) - .Background(Colors.Grey.Lighten3) - .DebugPointer("Example debug pointer") - .Stack(x => - { - x.Item().Text("Test"); - x.Item().Width(150); - }); - }); + Assert.Throws(() => + { + RenderingTest + .Create() + .PageSize(500, 360) + .Render(container => + { + container + .Padding(10) + .Width(100) + .Background(Colors.Grey.Lighten3) + .DebugPointer("Example debug pointer") + .Stack(x => + { + x.Item().Text("Test"); + x.Item().Width(150); + }); + }); + }); } - + [Test] public void Simple() { - RenderingTest - .Create() - .PageSize(500, 360) - .Render(container => - { - container - .Padding(10) - .Width(100) - .Background(Colors.Grey.Lighten3) - .Width(150) - .Text("Test"); - }); + Assert.Throws(() => + { + RenderingTest + .Create() + .PageSize(500, 360) + .Render(container => + { + container + .Padding(10) + .Width(100) + .Background(Colors.Grey.Lighten3) + .Width(150) + .Text("Test"); + }); + }); } - + [Test] public void DebugPointer() { - RenderingTest - .Create() - .PageSize(500, 360) - .Render(container => - { - container - .Width(100) - .DebugPointer("Example debug pointer") - .Width(150); - }); + Assert.Throws(() => + { + RenderingTest + .Create() + .PageSize(500, 360) + .Render(container => + { + container + .Background(Colors.Grey.Lighten3) + .Padding(10) + .Width(100) + .DebugPointer("Example debug pointer") + .Width(150) + .Text("Example"); + }); + }); } } } \ No newline at end of file diff --git a/QuestPDF.Examples/ImageExamples.cs b/QuestPDF.Examples/ImageExamples.cs index ad24b57..fd0a599 100644 --- a/QuestPDF.Examples/ImageExamples.cs +++ b/QuestPDF.Examples/ImageExamples.cs @@ -1,5 +1,6 @@ using System.IO; using NUnit.Framework; +using QuestPDF.Drawing.Exceptions; using QuestPDF.Examples.Engine; using QuestPDF.Fluent; using QuestPDF.Helpers; @@ -36,12 +37,15 @@ namespace QuestPDF.Examples [Test] public void Exception() { - RenderingTest - .Create() - .PageSize(PageSizes.A5) - .ProducePdf() - .ShowResults() - .Render(page => page.Image("non_existent.png")); + Assert.Throws(() => + { + RenderingTest + .Create() + .PageSize(PageSizes.A2) + .ProducePdf() + .ShowResults() + .Render(page => page.Image("non_existent.png")); + }); } } } \ No newline at end of file