|
8 | 8 | using GeneXus.Utils; |
9 | 9 | using UnitTesting; |
10 | 10 | using Xunit; |
| 11 | +#if NETCORE |
| 12 | +using Image = GeneXus.Drawing.Image; |
| 13 | +using GeneXus.Drawing.Imaging; |
| 14 | +#else |
| 15 | +using Image = System.Drawing.Image; |
| 16 | +using System.Drawing.Imaging; |
| 17 | +#endif |
11 | 18 |
|
12 | 19 | namespace DotNetCoreUnitTest.ImageUtils |
13 | 20 | { |
@@ -128,17 +135,17 @@ public void TestImageSaveFromSignedUrlDoesNotEmbedQueryString() |
128 | 135 | string signedUrl = "https://bucket.s3.amazonaws.com/folder/bird-thumbnail.jpg?X-Amz-Expires=86400&X-Amz-Signature=abc123def456&X-Amz-Algorithm=AWS4-HMAC-SHA256"; |
129 | 136 |
|
130 | 137 | string destinationPath; |
131 | | - using (System.Drawing.Image image = System.Drawing.Image.FromFile(IMAGE_FILE_PATH)) |
| 138 | + using (Image image = Image.FromFile(IMAGE_FILE_PATH)) |
132 | 139 | { |
133 | | - destinationPath = GxImageUtil.Save(image, signedUrl, System.Drawing.Imaging.ImageFormat.Jpeg); |
| 140 | + destinationPath = GxImageUtil.Save(image, signedUrl, ImageFormat.Jpeg); |
134 | 141 | } |
135 | 142 |
|
136 | 143 | Assert.False(string.IsNullOrEmpty(destinationPath)); |
137 | 144 | string destinationFileName = Path.GetFileName(destinationPath); |
138 | | - Assert.DoesNotContain("?", destinationFileName); |
139 | | - Assert.DoesNotContain("%3F", destinationFileName); |
140 | | - Assert.DoesNotContain("X-Amz-Expires", destinationFileName); |
141 | | - Assert.DoesNotContain("X-Amz-Signature", destinationFileName); |
| 145 | + Assert.DoesNotContain("?", destinationFileName, StringComparison.Ordinal); |
| 146 | + Assert.DoesNotContain("%3F", destinationFileName, StringComparison.Ordinal); |
| 147 | + Assert.DoesNotContain("X-Amz-Expires", destinationFileName, StringComparison.Ordinal); |
| 148 | + Assert.DoesNotContain("X-Amz-Signature", destinationFileName, StringComparison.Ordinal); |
142 | 149 |
|
143 | 150 | Assert.Equal(IMAGE_HEIGHT, GxImageUtil.GetImageHeight(destinationPath)); |
144 | 151 | Assert.Equal(IMAGE_WIDTH, GxImageUtil.GetImageWidth(destinationPath)); |
|
0 commit comments