DebuggingTesting.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. .Render(container =>
  61. {
  62. container
  63. .Background(Colors.Grey.Lighten3)
  64. .Padding(10)
  65. .Width(100)
  66. .DebugPointer("Example debug pointer")
  67. .Width(150)
  68. .Text("Example");
  69. });
  70. });
  71. }
  72. }
  73. }