Browse Source

Refactor image test setup and remove unnecessary ICC profile handling (as PDF/A-1a/1b are not supported at this moment)

Marcin Ziąbek 1 week ago
parent
commit
c63375f196

+ 1 - 18
Source/QuestPDF.ConformanceTests/ImageTests.cs

@@ -8,26 +8,9 @@ namespace QuestPDF.ConformanceTests;
 
 internal class ImageTests : ConformanceTestBase
 {
-    [OneTimeSetUp]
-    public void Setup()
-    {
-        // PDF/A-1a and PDF/A-1b require ICC profile version 2
-        // prepare an image with ICC profile version 2
-        var sourceImagePath = Path.Combine("Resources", "photo.jpeg");
-        var targetImagePath = Path.Combine("Resources", "photo-icc2.jpeg");
-
-        ImageHelpers.ConvertImageIccColorSpaceProfileToVersion2(sourceImagePath, targetImagePath);
-    }
-
     protected override Document GetDocumentUnderTest()
     {
-        var useImageWithIcc2 = TestContext.CurrentContext.Test.Arguments.FirstOrDefault() is PDFA_Conformance.PDFA_1A or PDFA_Conformance.PDFA_1B;
-        
-        var imagePath = useImageWithIcc2 
-            ? Path.Combine("Resources", "photo-icc2.jpeg") 
-            : Path.Combine("Resources", "photo.jpeg");
-
-        var imageData = File.ReadAllBytes(imagePath);
+        var imageData = File.ReadAllBytes("Resources/photo.jpeg");
         
         return Document
             .Create(document =>

+ 1 - 3
Source/QuestPDF.ConformanceTests/StyledBoxTests.cs

@@ -10,8 +10,6 @@ internal class StyledBoxTests : ConformanceTestBase
 {
     protected override Document GetDocumentUnderTest()
     {
-        var avoidTransparency = TestContext.CurrentContext.Test.Arguments.FirstOrDefault() is PDFA_Conformance.PDFA_1A or PDFA_Conformance.PDFA_1B;
-        
         return Document
             .Create(document =>
             {
@@ -51,7 +49,7 @@ internal class StyledBoxTests : ConformanceTestBase
                                 {
                                     OffsetX = 5,
                                     OffsetY = 5,
-                                    Blur = avoidTransparency ? 0 : 10,
+                                    Blur = 10,
                                     Spread = 5,
                                     Color = Colors.Grey.Medium
                                 })