RotateTests.cs 823 B

123456789101112131415161718192021222324252627282930313233
  1. using QuestPDF.Fluent;
  2. using QuestPDF.Helpers;
  3. namespace QuestPDF.VisualTests;
  4. public class RotateTests
  5. {
  6. [Test]
  7. public void Rotate(
  8. [Values(-15, 0, 30, 45, 60, 90)] int angle)
  9. {
  10. VisualTest.PerformWithDefaultPageSettings(container =>
  11. {
  12. container
  13. .Width(300)
  14. .Height(300)
  15. .AlignCenter()
  16. .AlignMiddle()
  17. .Unconstrained()
  18. .Rotate(angle) // <-
  19. .TranslateX(-100)
  20. .TranslateY(-50)
  21. .Width(200)
  22. .Height(100)
  23. .Background(Colors.Grey.Lighten3)
  24. .AlignCenter()
  25. .AlignMiddle()
  26. .Text($"Rotation: {angle} deg");
  27. });
  28. }
  29. }