DebuggingTesting.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using NUnit.Framework;
  2. using QuestPDF.Drawing.Exceptions;
  3. using QuestPDF.Examples.Engine;
  4. using QuestPDF.Fluent;
  5. using QuestPDF.Helpers;
  6. namespace QuestPDF.Examples
  7. {
  8. public class DebuggingTesting
  9. {
  10. [Test]
  11. public void Column()
  12. {
  13. Assert.Throws<DocumentLayoutException>(() =>
  14. {
  15. RenderingTest
  16. .Create()
  17. .PageSize(500, 360)
  18. .Render(container =>
  19. {
  20. container
  21. .Padding(10)
  22. .Width(100)
  23. .Background(Colors.Grey.Lighten3)
  24. .DebugPointer("Example debug pointer")
  25. .Column(x =>
  26. {
  27. x.Item().Text("Test");
  28. x.Item().Width(150);
  29. });
  30. });
  31. });
  32. }
  33. [Test]
  34. public void Simple()
  35. {
  36. Assert.Throws<DocumentLayoutException>(() =>
  37. {
  38. RenderingTest
  39. .Create()
  40. .PageSize(500, 360)
  41. .Render(container =>
  42. {
  43. container
  44. .Padding(10)
  45. .Width(100)
  46. .Background(Colors.Grey.Lighten3)
  47. .Width(150)
  48. .Text("Test");
  49. });
  50. });
  51. }
  52. [Test]
  53. public void DebugPointer()
  54. {
  55. Assert.Throws<DocumentLayoutException>(() =>
  56. {
  57. RenderingTest
  58. .Create()
  59. .PageSize(500, 360)
  60. .EnableDebugging(false)
  61. .Render(container =>
  62. {
  63. container
  64. .Background(Colors.Grey.Lighten3)
  65. .Padding(10)
  66. .Width(100)
  67. .DebugPointer("Example debug pointer")
  68. .Width(150)
  69. .Text("Example");
  70. });
  71. });
  72. }
  73. }
  74. }