Files
QuestPDF/Source/QuestPDF.UnitTests/BackgroundTests.cs
T
2023-01-06 00:45:12 +01:00

43 lines
1.2 KiB
C#

using NUnit.Framework;
using QuestPDF.Elements;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;
using QuestPDF.UnitTests.TestEngine;
namespace QuestPDF.UnitTests
{
[TestFixture]
public class BackgroundTests
{
[Test]
public void Measure() => SimpleContainerTests.Measure<Background>();
[Test]
public void Draw_ShouldHandleNullChild()
{
TestPlan
.For(x => new Background
{
Color = Colors.Red.Medium
})
.DrawElement(new Size(400, 300))
.ExpectCanvasDrawRectangle(new Position(0, 0), new Size(400, 300), Colors.Red.Medium)
.CheckDrawResult();
}
[Test]
public void Draw_ShouldHandleChild()
{
TestPlan
.For(x => new Background
{
Color = Colors.Red.Medium,
Child = x.CreateChild()
})
.DrawElement(new Size(400, 300))
.ExpectCanvasDrawRectangle(new Position(0, 0), new Size(400, 300), Colors.Red.Medium)
.ExpectChildDraw(new Size(400, 300))
.CheckDrawResult();
}
}
}