| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using QuestPDF.ConformanceTests.TestEngine;
- using QuestPDF.Drawing;
- using QuestPDF.Fluent;
- using QuestPDF.Helpers;
- using QuestPDF.Infrastructure;
- namespace QuestPDF.ConformanceTests;
- internal class StyledBoxTests : ConformanceTestBase
- {
- protected override Document GetDocumentUnderTest()
- {
- return Document
- .Create(document =>
- {
- document.Page(page =>
- {
- page.Margin(60);
- page.Content()
- .PaddingVertical(30)
- .SemanticSection()
- .Column(column =>
- {
- column.Spacing(30);
- column.Item()
- .SemanticHeader1()
- .Text("Conformance Test: Styled Boxes")
- .FontSize(36)
- .Bold()
- .FontColor(Colors.Blue.Darken2);
- column.Item()
- .Background(Colors.Blue.Lighten4)
- .Padding(20)
- .Text("Background only")
- .FontSize(16);
- column.Item()
- .Border(2, Colors.Blue.Darken2)
- .Padding(20)
- .Text("Border only")
- .FontSize(16);
- column.Item()
- .Background(Colors.White)
- .Shadow(new BoxShadowStyle
- {
- OffsetX = 5,
- OffsetY = 5,
- Blur = 10,
- Spread = 5,
- Color = Colors.Grey.Medium
- })
- .Padding(20)
- .Text("Simple shadow")
- .FontSize(16);
- column.Item()
- .Border(1, Colors.Purple.Lighten4)
- .Background(Colors.Purple.Lighten5)
- .CornerRadius(15)
- .Padding(20)
- .Text("Rounded corners")
- .FontSize(16);
- });
- });
- });
- }
- protected override SemanticTreeNode? GetExpectedSemanticTree()
- {
- return ExpectedSemanticTree.DocumentRoot(root =>
- {
- root.Child("Sect", sect =>
- {
- sect.Child("H1", h1 => h1.Alt("Conformance Test: Styled Boxes"));
- foreach (var i in Enumerable.Range(1, 4))
- sect.Child("P");
- });
- });
- }
- }
|