Added missing assertions to test that are supposed to throw an exception

This commit is contained in:
Marcin Ziąbek
2021-12-09 17:10:45 +01:00
parent 10683776bb
commit 5f636beb9d
2 changed files with 63 additions and 46 deletions
+10 -6
View File
@@ -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<DocumentComposeException>(() =>
{
RenderingTest
.Create()
.PageSize(PageSizes.A2)
.ProducePdf()
.ShowResults()
.Render(page => page.Image("non_existent.png"));
});
}
}
}