LineTests.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using QuestPDF.ConformanceTests.TestEngine;
  2. using QuestPDF.Drawing;
  3. using QuestPDF.Fluent;
  4. using QuestPDF.Helpers;
  5. using QuestPDF.Infrastructure;
  6. namespace QuestPDF.ConformanceTests;
  7. internal class LineTests : ConformanceTestBase
  8. {
  9. protected override Document GetDocumentUnderTest()
  10. {
  11. return Document
  12. .Create(document =>
  13. {
  14. document.Page(page =>
  15. {
  16. page.Margin(60);
  17. page.Content()
  18. .Column(column =>
  19. {
  20. column.Spacing(25);
  21. column.Item().Text("Line tests");
  22. column.Item()
  23. .LineHorizontal(6)
  24. .LineColor(Colors.Red.Medium);
  25. column.Item()
  26. .LineHorizontal(6)
  27. .LineColor(Colors.Green.Medium)
  28. .LineDashPattern([6, 6, 12, 6]);
  29. column.Item()
  30. .Height(150)
  31. .LineVertical(6)
  32. .LineGradient([ Colors.Blue.Lighten2, Colors.Blue.Darken2 ]);
  33. });
  34. });
  35. })
  36. .WithMetadata(new DocumentMetadata
  37. {
  38. Language = "en-US",
  39. Title = "Conformance Test",
  40. Subject = "Table of Contents"
  41. });
  42. }
  43. protected override SemanticTreeNode? GetExpectedSemanticTree()
  44. {
  45. return new SemanticTreeNode
  46. {
  47. NodeId = 1,
  48. Type = "Document",
  49. Children =
  50. {
  51. new SemanticTreeNode
  52. {
  53. NodeId = 2,
  54. Type = "P"
  55. }
  56. }
  57. };
  58. }
  59. }