Marcin Ziąbek 11 månader sedan
förälder
incheckning
cd744a65e8
1 ändrade filer med 23 tillägg och 22 borttagningar
  1. 23 22
      Source/QuestPDF.Examples/RoundedCornersExample.cs

+ 23 - 22
Source/QuestPDF.Examples/RoundedCornersExample.cs

@@ -1,5 +1,6 @@
 using System;
 using NUnit.Framework;
+using QuestPDF.Examples.Engine;
 using QuestPDF.Fluent;
 using QuestPDF.Helpers;
 using QuestPDF.Infrastructure;
@@ -11,31 +12,31 @@ public class RoundedCornersExample
     [Test]
     public void ItemTypes()
     {
-        Document
-            .Create(document =>
+        RenderingTest
+            .Create()
+            .ProducePdf()
+            .PageSize(650, 300)
+            .ShowResults()
+            .Render(container =>
             {
-                document.Page(page =>
+                var roundedRectangle = new RoundedRectangleParameters
                 {
-                    var roundedRectangle = new RoundedRectangleParameters
-                    {
-                        TopLeftRadius = 5,
-                        TopRightRadius = 10,
-                        BottomRightRadius = 15,
-                        BottomLeftRadius = 20,
-                        FillColor = Colors.Blue.Lighten3
-                    };
+                    TopLeftRadius = 5,
+                    TopRightRadius = 10,
+                    BottomRightRadius = 15,
+                    BottomLeftRadius = 20,
+                    FillColor = Colors.Blue.Lighten3
+                };
 
-                    page.Content()
-                        .Padding(10)
-                        .Shrink()
-                        .Layers(layers =>
-                        {
-                            layers.Layer().Svg(roundedRectangle.GenerateSVG);
-                            layers.PrimaryLayer().Padding(10).Text(Placeholders.Sentence());
-                        });
-                });
-            })
-            .GeneratePdfAndShow();
+                container
+                    .Padding(10)
+                    .Shrink()
+                    .Layers(layers =>
+                    {
+                        layers.Layer().Svg(roundedRectangle.GenerateSVG);
+                        layers.PrimaryLayer().Padding(10).Text(Placeholders.Sentence());
+                    });
+            });
     }
 }