diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index bd4fb522..f3a62d0f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -131,18 +131,15 @@ jobs: src/PDFtoImage/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }}/*.nupkg src/PDFtoImage/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }}/*.snupkg if-no-files-found: error - - name: Compress tests - shell: pwsh - run: Compress-Archive -Path src/Tests/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }}/* -DestinationPath TestAssemblies.zip -CompressionLevel "Fastest" - name: Publish tests uses: actions/upload-artifact@main if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_tests) == true with: name: Test assemblies - path: TestAssemblies.zip + path: src/Tests/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }} if-no-files-found: error retention-days: 1 - compression-level: 0 + compression-level: 9 - name: Publish test project MonoConsole uses: actions/upload-artifact@main if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_tests) == true @@ -195,10 +192,6 @@ jobs: uses: actions/download-artifact@main with: name: Test assemblies - - name: Expand tests - if: success() || failure() - shell: pwsh - run: Expand-Archive -Path TestAssemblies.zip -DestinationPath . - name: .NET Framework 4.6.2 if: runner.os == 'Windows' && (success() || failure()) run: dotnet test net462/*.Tests.dll --logger trx --verbosity detailed --results-directory "${{ matrix.os }}/TestResults" ${{ (github.event_name == 'workflow_dispatch' && inputs.generate_assets) == true && '--settings net462/SaveOutputInGeneratedFolder.runsettings' || '' }} diff --git a/src/Tests/AntiAliasingTests.cs b/src/Tests/AntiAliasingTests.cs index 57227f53..971c4008 100644 --- a/src/Tests/AntiAliasingTests.cs +++ b/src/Tests/AntiAliasingTests.cs @@ -33,9 +33,9 @@ public void Initialize() [DataRow(PdfAntiAliasing.All, DisplayName = "All")] public void SaveJpegWithAntiAliasing(PdfAntiAliasing? antiAliasing) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (antiAliasing == null) @@ -59,9 +59,9 @@ public void SaveJpegWithAntiAliasing(PdfAntiAliasing? antiAliasing) [DataRow(PdfAntiAliasing.All, DisplayName = "All")] public void SavePngWithAntiAliasing(PdfAntiAliasing? antiAliasing) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (antiAliasing == null) @@ -85,9 +85,9 @@ public void SavePngWithAntiAliasing(PdfAntiAliasing? antiAliasing) [DataRow(PdfAntiAliasing.All, DisplayName = "All")] public void SaveWebpWithAntiAliasing(PdfAntiAliasing? antiAliasing) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (antiAliasing == null) diff --git a/src/Tests/ApiTests.cs b/src/Tests/ApiTests.cs index 48b5ef28..023ef6ad 100644 --- a/src/Tests/ApiTests.cs +++ b/src/Tests/ApiTests.cs @@ -176,7 +176,7 @@ await Assert.ThrowsExceptionAsync(async () => [TestMethod] public void ToImageStreamLeaveOpenDefault() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); ToImage(inputStream); @@ -186,7 +186,7 @@ public void ToImageStreamLeaveOpenDefault() [TestMethod] public void ToImageStreamLeaveOpenFalse() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); ToImage(inputStream, false); @@ -196,7 +196,7 @@ public void ToImageStreamLeaveOpenFalse() [TestMethod] public void ToImageStreamLeaveOpenTrue() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); ToImage(inputStream, true); @@ -206,7 +206,7 @@ public void ToImageStreamLeaveOpenTrue() [TestMethod] public void ToImagesStreamLeaveOpenDefault() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImages(inputStream); @@ -219,7 +219,7 @@ public void ToImagesStreamLeaveOpenDefault() [TestMethod] public void ToImagesStreamLeaveOpenFalse() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImages(inputStream, false); @@ -232,7 +232,7 @@ public void ToImagesStreamLeaveOpenFalse() [TestMethod] public void ToImagesStreamLeaveOpenTrue() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImages(inputStream, true); @@ -246,7 +246,7 @@ public void ToImagesStreamLeaveOpenTrue() [TestMethod] public async Task ToImagesAsyncStreamLeaveOpenDefault() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImagesAsync(inputStream); @@ -259,7 +259,7 @@ public async Task ToImagesAsyncStreamLeaveOpenDefault() [TestMethod] public async Task ToImagesAsyncStreamLeaveOpenFalse() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImagesAsync(inputStream, false); @@ -272,7 +272,7 @@ public async Task ToImagesAsyncStreamLeaveOpenFalse() [TestMethod] public async Task ToImagesAsyncStreamLeaveOpenTrue() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImagesAsync(inputStream, true); @@ -286,7 +286,7 @@ public async Task ToImagesAsyncStreamLeaveOpenTrue() [TestMethod] public void GetPageCountStreamLeaveOpenDefault() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageCount(inputStream); @@ -296,7 +296,7 @@ public void GetPageCountStreamLeaveOpenDefault() [TestMethod] public void GetPageCountStreamLeaveOpenFalse() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageCount(inputStream, false); @@ -306,7 +306,7 @@ public void GetPageCountStreamLeaveOpenFalse() [TestMethod] public void GetPageCountStreamLeaveOpenTrue() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageCount(inputStream, true); @@ -316,7 +316,7 @@ public void GetPageCountStreamLeaveOpenTrue() [TestMethod] public void GetPageSizeStreamLeaveOpenDefault() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageSize(inputStream, page: 0); @@ -326,7 +326,7 @@ public void GetPageSizeStreamLeaveOpenDefault() [TestMethod] public void GetPageSizeStreamLeaveOpenFalse() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageSize(inputStream, false, 0); @@ -336,7 +336,7 @@ public void GetPageSizeStreamLeaveOpenFalse() [TestMethod] public void GetPageSizeStreamLeaveOpenTrue() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageSize(inputStream, true, 0); @@ -346,7 +346,7 @@ public void GetPageSizeStreamLeaveOpenTrue() [TestMethod] public void GetPageSizesStreamLeaveOpenDefault() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageSizes(inputStream); @@ -356,7 +356,7 @@ public void GetPageSizesStreamLeaveOpenDefault() [TestMethod] public void GetPageSizesStreamLeaveOpenFalse() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageSizes(inputStream, false); @@ -366,7 +366,7 @@ public void GetPageSizesStreamLeaveOpenFalse() [TestMethod] public void GetPageSizesStreamLeaveOpenTrue() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageSizes(inputStream, true); @@ -376,7 +376,7 @@ public void GetPageSizesStreamLeaveOpenTrue() [TestMethod] public void StreamMultipleCallsLeaveOpen() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); GetPageCount(inputStream, true); diff --git a/src/Tests/AspectRatioTests.cs b/src/Tests/AspectRatioTests.cs index d581b83d..ea01831d 100644 --- a/src/Tests/AspectRatioTests.cs +++ b/src/Tests/AspectRatioTests.cs @@ -134,9 +134,9 @@ public class AspectRatioTests : TestBase [DataRow("Wikimedia_Commons_web.pdf", 2000, 2000, 1200)] public void WithoutAspectRatio(string fileName, int? width = null, int? height = null, int? dpi = null) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, dpi, false)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, dpi, false)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream = CreateOutputStream(expectedPath); if (dpi != null) @@ -272,9 +272,9 @@ public void WithoutAspectRatio(string fileName, int? width = null, int? height = [DataRow("Wikimedia_Commons_web.pdf", 2000, 2000, 1200)] public void WithAspectRatio(string fileName, int? width = null, int? height = null, int? dpi = null) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, dpi, true)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, dpi, true)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream = CreateOutputStream(expectedPath); if (dpi != null) @@ -344,9 +344,9 @@ public void WithAspectRatio(string fileName, int? width = null, int? height = nu [DataRow("Wikimedia_Commons_web.pdf", 2000, 2000, true)] public void IgnoreDpi(string fileName, int? width = null, int? height = null, bool withAspectRatio = false) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, 300, withAspectRatio)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, 300, withAspectRatio)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); for (int i = 72; i < 600; i += 100) { @@ -369,9 +369,9 @@ public void IgnoreDpi(string fileName, int? width = null, int? height = null, bo [DataRow("Wikimedia_Commons_web.pdf", 2000, 2000)] public void IgnoreAspectRatio(string fileName, int width, int height) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, 300, true)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, 300, true)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream1 = CreateOutputStream(expectedPath); using var outputStream2 = CreateOutputStream(expectedPath); @@ -394,9 +394,9 @@ public void IgnoreAspectRatio(string fileName, int width, int height) [DataRow("Wikimedia_Commons_web.pdf", 600)] public void IgnoreAspectRatioWithDpi(string fileName, int dpi) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", null, null, dpi, true)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", null, null, dpi, true)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream1 = CreateOutputStream(expectedPath); using var outputStream2 = CreateOutputStream(expectedPath); diff --git a/src/Tests/BackgroundColorTests.cs b/src/Tests/BackgroundColorTests.cs index 43943b8d..059c6e9a 100644 --- a/src/Tests/BackgroundColorTests.cs +++ b/src/Tests/BackgroundColorTests.cs @@ -40,9 +40,9 @@ public void Initialize() [DataRow((uint)0x00FFFFFF, DisplayName = "Transparent")] public void SaveJpegWithBackgroundColor(uint? backgroundColor) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (backgroundColor == null) @@ -74,9 +74,9 @@ public void SaveJpegWithBackgroundColor(uint? backgroundColor) [DataRow((uint)0x00FFFFFF, DisplayName = "Transparent")] public void SavePngWithBackgroundColor(uint? backgroundColor) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (backgroundColor == null) @@ -108,9 +108,9 @@ public void SavePngWithBackgroundColor(uint? backgroundColor) [DataRow((uint)0x00FFFFFF, DisplayName = "Transparent")] public void SaveWebpWithBackgroundColor(uint? backgroundColor) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (backgroundColor == null) diff --git a/src/Tests/BoundsTests.cs b/src/Tests/BoundsTests.cs index 8a705179..a03a8aec 100644 --- a/src/Tests/BoundsTests.cs +++ b/src/Tests/BoundsTests.cs @@ -17,9 +17,9 @@ public class BoundsTests : TestBase [DataRow(default)] public void NullOrDefault(RectangleF? bounds = null) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, default, default, default)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, default, default, default)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SavePng(outputStream, inputStream, options: new(Dpi: 300, Bounds: bounds)); @@ -42,9 +42,9 @@ public void NullOrDefault(RectangleF? bounds = null) public void Normal(float x, float y, float width, float height) { var bounds = new RectangleF(x, y, width, height); - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, default, default, default)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, default, default, default)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SavePng(outputStream, inputStream, options: new(Dpi: 300, Bounds: bounds)); @@ -87,9 +87,9 @@ public void Normal(float x, float y, float width, float height) public void WithRotation(float x, float y, float width, float height, PdfRotation? rotation) { var bounds = new RectangleF(x, y, width, height); - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, rotation, default, default, default)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, rotation, default, default, default)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (rotation != null) @@ -119,9 +119,9 @@ public void WithRotation(float x, float y, float width, float height, PdfRotatio public void WithAnnotations(float x, float y, float width, float height, bool? withAnnotations = null) { var bounds = new RectangleF(x, y, width, height); - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, withAnnotations, default, default)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, withAnnotations, default, default)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (withAnnotations != null) @@ -151,9 +151,9 @@ public void WithAnnotations(float x, float y, float width, float height, bool? w public void WithFormFill(float x, float y, float width, float height, bool? withFormFill = null) { var bounds = new RectangleF(x, y, width, height); - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Bounds", $"hundesteuer-anmeldung_{GetFileName(bounds, default, default, withFormFill, default)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Bounds", $"hundesteuer-anmeldung_{GetFileName(bounds, default, default, withFormFill, default)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (withFormFill != null) @@ -178,9 +178,9 @@ public void WithFormFill(float x, float y, float width, float height, bool? with public void WithWidthAndHeight(float x, float y, float width, float height, int? outputWidth = null, int? outputHeight = null) { var bounds = new RectangleF(x, y, width, height); - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, default, default, default)}_{outputWidth?.ToString() ?? "null"}x{outputHeight?.ToString() ?? "null"}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, default, default, default)}_{outputWidth?.ToString() ?? "null"}x{outputHeight?.ToString() ?? "null"}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SavePng(outputStream, inputStream, options: new(Width: outputWidth, Height: outputHeight, Bounds: bounds)); @@ -246,9 +246,9 @@ public void WithWidthAndHeight(float x, float y, float width, float height, int? public void WithWidthAndHeightAndRotation(float x, float y, float width, float height, int? outputWidth = null, int? outputHeight = null, PdfRotation? rotation = null) { var bounds = new RectangleF(x, y, width, height); - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, rotation, default, default, default)}_{outputWidth?.ToString() ?? "null"}x{outputHeight?.ToString() ?? "null"}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, rotation, default, default, default)}_{outputWidth?.ToString() ?? "null"}x{outputHeight?.ToString() ?? "null"}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SavePng(outputStream, inputStream, options: new(Width: outputWidth, Height: outputHeight, Bounds: bounds, Rotation: rotation ?? default)); @@ -424,9 +424,9 @@ public void WithWidthAndHeightAndRotation(float x, float y, float width, float h public void WithWidthAndHeightAndRotationAndDpiRelative(float x, float y, float width, float height, int? outputWidth = null, int? outputHeight = null, PdfRotation? rotation = null, bool? dpiRelativeToBounds = null) { var bounds = new RectangleF(x, y, width, height); - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, rotation, default, default, dpiRelativeToBounds)}_{outputWidth?.ToString() ?? "null"}x{outputHeight?.ToString() ?? "null"}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, rotation, default, default, dpiRelativeToBounds)}_{outputWidth?.ToString() ?? "null"}x{outputHeight?.ToString() ?? "null"}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (dpiRelativeToBounds != null) @@ -460,9 +460,9 @@ public void WithWidthAndHeightAndRotationAndDpiRelative(float x, float y, float public void WithDpiRelative(float x, float y, float width, float height, bool? dpiRelativeToBounds = null) { var bounds = new RectangleF(x, y, width, height); - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, default, default, dpiRelativeToBounds)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Bounds", $"Wikimedia_Commons_web_{GetFileName(bounds, default, default, default, dpiRelativeToBounds)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (dpiRelativeToBounds != null) diff --git a/src/Tests/ComparisonTests.cs b/src/Tests/ComparisonTests.cs index 13a0d551..10af967f 100644 --- a/src/Tests/ComparisonTests.cs +++ b/src/Tests/ComparisonTests.cs @@ -58,9 +58,9 @@ public class ComparisonTests : TestBase [DataRow(19, true, DisplayName = "Page 20 (with annotations)")] public void SaveWebpPageNumber(int page, bool withAnnotations = false) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SaveWebp(outputStream, inputStream, page: page, options: new(Dpi: 40, WithAnnotations: withAnnotations)); @@ -73,13 +73,13 @@ public void SaveWebpPageNumber(int page, bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public void SaveWebpPages(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; foreach (var image in ToImages(inputStream, options: new(Dpi: 40, WithAnnotations: withAnnotations))) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Webp, 100); @@ -96,13 +96,13 @@ public void SaveWebpPages(bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public async Task SaveWebpPagesAsync(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; await foreach (var image in ToImagesAsync(inputStream, options: new(Dpi: 40, WithAnnotations: withAnnotations))) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Webp, 100); @@ -157,9 +157,9 @@ public async Task SaveWebpPagesAsync(bool withAnnotations = false) [DataRow(19, true, DisplayName = "Page 20 (with annotations)")] public void SavePngPageNumber(int page, bool withAnnotations = false) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SavePng(outputStream, inputStream, page: page, options: new(Dpi: 40, WithAnnotations: withAnnotations)); @@ -172,13 +172,13 @@ public void SavePngPageNumber(int page, bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public void SavePngPages(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; foreach (var image in ToImages(inputStream, options: new(Dpi: 40, WithAnnotations: withAnnotations))) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Png, 100); @@ -195,13 +195,13 @@ public void SavePngPages(bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public async Task SavePngPagesAsync(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; await foreach (var image in ToImagesAsync(inputStream, options: new(Dpi: 40, WithAnnotations: withAnnotations))) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Png, 100); @@ -256,9 +256,9 @@ public async Task SavePngPagesAsync(bool withAnnotations = false) [DataRow(19, true, DisplayName = "Page 20 (with annotations)")] public void SaveJpegPageNumber(int page, bool withAnnotations = false) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SaveJpeg(outputStream, inputStream, page: page, options: new(Dpi: 40, WithAnnotations: withAnnotations)); @@ -271,13 +271,13 @@ public void SaveJpegPageNumber(int page, bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public void SaveJpegPages(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; foreach (var image in ToImages(inputStream, options: new(Dpi: 40, WithAnnotations: withAnnotations))) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Jpeg, 100); @@ -294,13 +294,13 @@ public void SaveJpegPages(bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public async Task SaveJpegPagesAsync(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; await foreach (var image in ToImagesAsync(inputStream, options: new(Dpi: 40, WithAnnotations: withAnnotations))) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Jpeg, 100); @@ -327,10 +327,10 @@ public async Task SaveJpegPagesAsync(bool withAnnotations = false) [DataRow(1200, true, DisplayName = "1200 DPI (with annotations)")] public void SavePngDpi(int dpi, bool withAnnotations = false) { - using var pdfStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); using var image = ToImage(pdfStream, options: new(Dpi: dpi, WithAnnotations: withAnnotations)); - using var pdfStream2 = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream2 = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); using var image2 = ToImage(pdfStream2, options: new(Dpi: 300, WithAnnotations: withAnnotations)); Assert.IsNotNull(image); @@ -353,10 +353,10 @@ public void SavePngDpi(int dpi, bool withAnnotations = false) [DataRow(1200, true, DisplayName = "1200 DPI (with annotations)")] public void SavePngDpiImages(int dpi, bool withAnnotations = false) { - using var pdfStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); using var image = ToImages(pdfStream, options: new(Dpi: dpi, WithAnnotations: withAnnotations)).Single(); - using var pdfStream2 = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream2 = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); using var image2 = ToImages(pdfStream2, options: new(Dpi: 300, WithAnnotations: withAnnotations)).Single(); Assert.IsNotNull(image); @@ -380,7 +380,7 @@ public void SavePngDpiImages(int dpi, bool withAnnotations = false) [DataRow(1200, true, DisplayName = "1200 DPI (with annotations)")] public async Task SavePngDpiImagesAsync(int dpi, bool withAnnotations = false) { - using var pdfStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); await foreach (var image in ToImagesAsync(pdfStream, options: new(Dpi: dpi, WithAnnotations: withAnnotations))) { @@ -395,7 +395,7 @@ public async Task SavePngDpiImagesAsync(int dpi, bool withAnnotations = false) [DataRow("Wikimedia_Commons_web.pdf", 20)] public void GetPageCountTest(string pdfFileName, int expectedPageCount) { - using var pdfStream = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var pdfStream = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); Assert.AreEqual(expectedPageCount, GetPageCount(pdfStream), $"The expected and actual page count for the file {pdfFileName} are not equal."); } @@ -406,7 +406,7 @@ public void GetPageCountTest(string pdfFileName, int expectedPageCount) [DataRow("Wikimedia_Commons_web.pdf")] public async Task ToImagesAsyncTaskCanceledException(string pdfFileName) { - using var inputStream = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); var token = new CancellationTokenSource(); await Assert.ThrowsExceptionAsync(async () => @@ -425,11 +425,11 @@ await Assert.ThrowsExceptionAsync(async () => [DataRow("Wikimedia_Commons_web.pdf")] public async Task ToImagesAsyncOperationCanceledException(string pdfFileName) { - using var inputStream = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); var token = new CancellationTokenSource(); var pageCount = GetPageCount(inputStream); - using var inputStream2 = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var inputStream2 = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); if (pageCount < 2) { diff --git a/src/Tests/Compatibility/AntiAliasingTests.cs b/src/Tests/Compatibility/AntiAliasingTests.cs index 82a1305a..a0db4423 100644 --- a/src/Tests/Compatibility/AntiAliasingTests.cs +++ b/src/Tests/Compatibility/AntiAliasingTests.cs @@ -35,9 +35,9 @@ public void Initialize() [DataRow(PdfAntiAliasing.All, DisplayName = "All")] public void SaveJpegWithAntiAliasing(PdfAntiAliasing? antiAliasing) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (antiAliasing == null) @@ -61,9 +61,9 @@ public void SaveJpegWithAntiAliasing(PdfAntiAliasing? antiAliasing) [DataRow(PdfAntiAliasing.All, DisplayName = "All")] public void SavePngWithAntiAliasing(PdfAntiAliasing? antiAliasing) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (antiAliasing == null) @@ -87,9 +87,9 @@ public void SavePngWithAntiAliasing(PdfAntiAliasing? antiAliasing) [DataRow(PdfAntiAliasing.All, DisplayName = "All")] public void SaveWebpWithAntiAliasing(PdfAntiAliasing? antiAliasing) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AntiAliasing", $"hundesteuer-anmeldung_{GetFileName(antiAliasing ?? PdfAntiAliasing.All)}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (antiAliasing == null) diff --git a/src/Tests/Compatibility/ApiTests.cs b/src/Tests/Compatibility/ApiTests.cs index 2c2fc8b3..35bc9770 100644 --- a/src/Tests/Compatibility/ApiTests.cs +++ b/src/Tests/Compatibility/ApiTests.cs @@ -123,7 +123,7 @@ await Assert.ThrowsExceptionAsync(async () => [TestMethod] public void ToImageStreamLeaveOpenDefault() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); ToImage(inputStream); @@ -133,7 +133,7 @@ public void ToImageStreamLeaveOpenDefault() [TestMethod] public void ToImageStreamLeaveOpenFalse() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); ToImage(inputStream, false); @@ -143,7 +143,7 @@ public void ToImageStreamLeaveOpenFalse() [TestMethod] public void ToImageStreamLeaveOpenTrue() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); ToImage(inputStream, true); @@ -153,7 +153,7 @@ public void ToImageStreamLeaveOpenTrue() [TestMethod] public void ToImagesStreamLeaveOpenDefault() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImages(inputStream); @@ -166,7 +166,7 @@ public void ToImagesStreamLeaveOpenDefault() [TestMethod] public void ToImagesStreamLeaveOpenFalse() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImages(inputStream, false); @@ -179,7 +179,7 @@ public void ToImagesStreamLeaveOpenFalse() [TestMethod] public void ToImagesStreamLeaveOpenTrue() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImages(inputStream, true); @@ -193,7 +193,7 @@ public void ToImagesStreamLeaveOpenTrue() [TestMethod] public async Task ToImagesAsyncStreamLeaveOpenDefault() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImagesAsync(inputStream); @@ -206,7 +206,7 @@ public async Task ToImagesAsyncStreamLeaveOpenDefault() [TestMethod] public async Task ToImagesAsyncStreamLeaveOpenFalse() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImagesAsync(inputStream, false); @@ -219,7 +219,7 @@ public async Task ToImagesAsyncStreamLeaveOpenFalse() [TestMethod] public async Task ToImagesAsyncStreamLeaveOpenTrue() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); var result = ToImagesAsync(inputStream, true); @@ -233,7 +233,7 @@ public async Task ToImagesAsyncStreamLeaveOpenTrue() [TestMethod] public void StreamMultipleCallsLeaveOpen() { - using var inputStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); Assert.IsTrue(inputStream.CanRead); PDFtoImage.Conversion.GetPageCount(inputStream, true); diff --git a/src/Tests/Compatibility/AspectRatioTests.cs b/src/Tests/Compatibility/AspectRatioTests.cs index b16a1a45..48a97070 100644 --- a/src/Tests/Compatibility/AspectRatioTests.cs +++ b/src/Tests/Compatibility/AspectRatioTests.cs @@ -135,9 +135,9 @@ public class AspectRatioTests : TestBase [DataRow("Wikimedia_Commons_web.pdf", 2000, 2000, 1200)] public void WithoutAspectRatio(string fileName, int? width = null, int? height = null, int? dpi = null) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, dpi, false)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, dpi, false)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream = CreateOutputStream(expectedPath); if (dpi != null) @@ -273,9 +273,9 @@ public void WithoutAspectRatio(string fileName, int? width = null, int? height = [DataRow("Wikimedia_Commons_web.pdf", 2000, 2000, 1200)] public void WithAspectRatio(string fileName, int? width = null, int? height = null, int? dpi = null) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, dpi, true)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, dpi, true)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream = CreateOutputStream(expectedPath); if (dpi != null) @@ -345,9 +345,9 @@ public void WithAspectRatio(string fileName, int? width = null, int? height = nu [DataRow("Wikimedia_Commons_web.pdf", 2000, 2000, true)] public void IgnoreDpi(string fileName, int? width = null, int? height = null, bool withAspectRatio = false) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, 300, withAspectRatio)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, 300, withAspectRatio)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); for (int i = 72; i < 600; i += 100) { @@ -370,9 +370,9 @@ public void IgnoreDpi(string fileName, int? width = null, int? height = null, bo [DataRow("Wikimedia_Commons_web.pdf", 2000, 2000)] public void IgnoreAspectRatio(string fileName, int width, int height) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, 300, true)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", width, height, 300, true)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream1 = CreateOutputStream(expectedPath); using var outputStream2 = CreateOutputStream(expectedPath); @@ -395,9 +395,9 @@ public void IgnoreAspectRatio(string fileName, int width, int height) [DataRow("Wikimedia_Commons_web.pdf", 600)] public void IgnoreAspectRatioWithDpi(string fileName, int dpi) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", null, null, dpi, true)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "AspectRatio", GetExpectedFilename(fileName, "jpg", null, null, dpi, true)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream1 = CreateOutputStream(expectedPath); using var outputStream2 = CreateOutputStream(expectedPath); diff --git a/src/Tests/Compatibility/BackgroundColorTests.cs b/src/Tests/Compatibility/BackgroundColorTests.cs index f42b3824..290dda63 100644 --- a/src/Tests/Compatibility/BackgroundColorTests.cs +++ b/src/Tests/Compatibility/BackgroundColorTests.cs @@ -41,9 +41,9 @@ public void Initialize() [DataRow((uint)0x00FFFFFF, DisplayName = "Transparent")] public void SaveJpegWithBackgroundColor(uint? backgroundColor) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (backgroundColor == null) @@ -75,9 +75,9 @@ public void SaveJpegWithBackgroundColor(uint? backgroundColor) [DataRow((uint)0x00FFFFFF, DisplayName = "Transparent")] public void SavePngWithBackgroundColor(uint? backgroundColor) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (backgroundColor == null) @@ -109,9 +109,9 @@ public void SavePngWithBackgroundColor(uint? backgroundColor) [DataRow((uint)0x00FFFFFF, DisplayName = "Transparent")] public void SaveWebpWithBackgroundColor(uint? backgroundColor) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "BackgroundColor", $"hundesteuer-anmeldung_{GetFileName(backgroundColor ?? SKColors.White)}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (backgroundColor == null) diff --git a/src/Tests/Compatibility/ComparisonTests.cs b/src/Tests/Compatibility/ComparisonTests.cs index 4c9dc9b9..d280c54e 100644 --- a/src/Tests/Compatibility/ComparisonTests.cs +++ b/src/Tests/Compatibility/ComparisonTests.cs @@ -58,9 +58,9 @@ public class ComparisonTests : TestBase [DataRow(19, true, DisplayName = "Page 20 (with annotations)")] public void SaveWebpPageNumber(int page, bool withAnnotations = false) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SaveWebp(outputStream, inputStream, page: page, dpi: 40, withAnnotations: withAnnotations); @@ -73,13 +73,13 @@ public void SaveWebpPageNumber(int page, bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public void SaveWebpPages(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; foreach (var image in ToImages(inputStream, dpi: 40, withAnnotations: withAnnotations)) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Webp, 100); @@ -96,13 +96,13 @@ public void SaveWebpPages(bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public async Task SaveWebpPagesAsync(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; await foreach (var image in ToImagesAsync(inputStream, dpi: 40, withAnnotations: withAnnotations)) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.webp"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Webp, 100); @@ -157,9 +157,9 @@ public async Task SaveWebpPagesAsync(bool withAnnotations = false) [DataRow(19, true, DisplayName = "Page 20 (with annotations)")] public void SavePngPageNumber(int page, bool withAnnotations = false) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SavePng(outputStream, inputStream, page: page, dpi: 40, withAnnotations: withAnnotations); @@ -172,13 +172,13 @@ public void SavePngPageNumber(int page, bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public void SavePngPages(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; foreach (var image in ToImages(inputStream, dpi: 40, withAnnotations: withAnnotations)) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Png, 100); @@ -195,13 +195,13 @@ public void SavePngPages(bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public async Task SavePngPagesAsync(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; await foreach (var image in ToImagesAsync(inputStream, dpi: 40, withAnnotations: withAnnotations)) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.png"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Png, 100); @@ -256,9 +256,9 @@ public async Task SavePngPagesAsync(bool withAnnotations = false) [DataRow(19, true, DisplayName = "Page 20 (with annotations)")] public void SaveJpegPageNumber(int page, bool withAnnotations = false) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); using var outputStream = CreateOutputStream(expectedPath); SaveJpeg(outputStream, inputStream, page: page, dpi: 40, withAnnotations: withAnnotations); @@ -271,13 +271,13 @@ public void SaveJpegPageNumber(int page, bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public void SaveJpegPages(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; foreach (var image in ToImages(inputStream, dpi: 40, withAnnotations: withAnnotations)) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Jpeg, 100); @@ -294,13 +294,13 @@ public void SaveJpegPages(bool withAnnotations = false) [DataRow(true, DisplayName = "With annotations")] public async Task SaveJpegPagesAsync(bool withAnnotations = false) { - using var inputStream = GetInputStream(Path.Combine("Assets", "Wikimedia_Commons_web.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "Wikimedia_Commons_web.pdf")); int page = 0; await foreach (var image in ToImagesAsync(inputStream, dpi: 40, withAnnotations: withAnnotations)) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"Wikimedia_Commons_web_{page}{(withAnnotations ? "_ANNOT" : string.Empty)}.jpg"); using var outputStream = CreateOutputStream(expectedPath); image.Encode(outputStream, SKEncodedImageFormat.Jpeg, 100); @@ -327,10 +327,10 @@ public async Task SaveJpegPagesAsync(bool withAnnotations = false) [DataRow(1200, true, DisplayName = "1200 DPI (with annotations)")] public void SavePngDpi(int dpi, bool withAnnotations = false) { - using var pdfStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); using var image = ToImage(pdfStream, dpi: dpi, withAnnotations: withAnnotations); - using var pdfStream2 = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream2 = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); using var image2 = ToImage(pdfStream2, dpi: 300, withAnnotations: withAnnotations); Assert.IsNotNull(image); @@ -353,10 +353,10 @@ public void SavePngDpi(int dpi, bool withAnnotations = false) [DataRow(1200, true, DisplayName = "1200 DPI (with annotations)")] public void SavePngDpiImages(int dpi, bool withAnnotations = false) { - using var pdfStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); using var image = ToImages(pdfStream, dpi: dpi, withAnnotations: withAnnotations).Single(); - using var pdfStream2 = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream2 = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); using var image2 = ToImages(pdfStream2, dpi: 300, withAnnotations: withAnnotations).Single(); Assert.IsNotNull(image); @@ -380,7 +380,7 @@ public void SavePngDpiImages(int dpi, bool withAnnotations = false) [DataRow(1200, true, DisplayName = "1200 DPI (with annotations)")] public async Task SavePngDpiImagesAsync(int dpi, bool withAnnotations = false) { - using var pdfStream = GetInputStream(Path.Combine("Assets", "SocialPreview.pdf")); + using var pdfStream = GetInputStream(Path.Combine("..", "Assets", "SocialPreview.pdf")); await foreach (var image in ToImagesAsync(pdfStream, dpi: dpi, withAnnotations: withAnnotations)) { @@ -396,7 +396,7 @@ public async Task SavePngDpiImagesAsync(int dpi, bool withAnnotations = false) [DataRow("Wikimedia_Commons_web.pdf")] public async Task ToImagesAsyncTaskCanceledException(string pdfFileName) { - using var inputStream = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); var token = new CancellationTokenSource(); await Assert.ThrowsExceptionAsync(async () => @@ -415,11 +415,11 @@ await Assert.ThrowsExceptionAsync(async () => [DataRow("Wikimedia_Commons_web.pdf")] public async Task ToImagesAsyncOperationCanceledException(string pdfFileName) { - using var inputStream = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); var token = new CancellationTokenSource(); var pageCount = PDFtoImage.Conversion.GetPageCount(inputStream); - using var inputStream2 = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var inputStream2 = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); if (pageCount < 2) { diff --git a/src/Tests/Compatibility/ExceptionTests.cs b/src/Tests/Compatibility/ExceptionTests.cs index 0d55aa86..e57a6eb2 100644 --- a/src/Tests/Compatibility/ExceptionTests.cs +++ b/src/Tests/Compatibility/ExceptionTests.cs @@ -18,7 +18,7 @@ public class ExceptionTests : TestBase [DataRow("Wikimedia_Commons_web.pdf")] public void ThrowsPageNotFound(string inputFile) { - using var inputStream = GetInputStream(Path.Combine("Assets", inputFile)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", inputFile)); Assert.ThrowsException(() => ToImage(inputStream, page: 80085)); } } diff --git a/src/Tests/Compatibility/FormFillTests.cs b/src/Tests/Compatibility/FormFillTests.cs index abf42756..479351d9 100644 --- a/src/Tests/Compatibility/FormFillTests.cs +++ b/src/Tests/Compatibility/FormFillTests.cs @@ -26,9 +26,9 @@ public void Initialize() [DataRow(false, DisplayName = "No form fill")] public void SaveWebpPageNumber(bool? withFormFill) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (withFormFill == null) @@ -45,9 +45,9 @@ public void SaveWebpPageNumber(bool? withFormFill) [DataRow(false, DisplayName = "No form fill")] public void SavePngPageNumber(bool? withFormFill) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (withFormFill == null) @@ -64,9 +64,9 @@ public void SavePngPageNumber(bool? withFormFill) [DataRow(false, DisplayName = "No form fill")] public void SaveJpegPageNumber(bool? withFormFill) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (withFormFill == null) diff --git a/src/Tests/Compatibility/RotationTests.cs b/src/Tests/Compatibility/RotationTests.cs index 7ebf80e9..84ae4133 100644 --- a/src/Tests/Compatibility/RotationTests.cs +++ b/src/Tests/Compatibility/RotationTests.cs @@ -20,9 +20,9 @@ public class RotationTests : TestBase [DataRow(PdfRotation.Rotate270, DisplayName = "Rotated 90 degrees counter-clockwise")] public void SaveWebpPageNumber(PdfRotation? rotation) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (rotation == null) @@ -41,9 +41,9 @@ public void SaveWebpPageNumber(PdfRotation? rotation) [DataRow(PdfRotation.Rotate270, DisplayName = "Rotated 90 degrees counter-clockwise")] public void SavePngPageNumber(PdfRotation? rotation) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (rotation == null) @@ -62,9 +62,9 @@ public void SavePngPageNumber(PdfRotation? rotation) [DataRow(PdfRotation.Rotate270, DisplayName = "Rotated 90 degrees counter-clockwise")] public void SaveJpegPageNumber(PdfRotation? rotation) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (rotation == null) @@ -118,9 +118,9 @@ public void SaveJpegPageNumber(PdfRotation? rotation) [DataRow(PdfRotation.Rotate270, 200, 200, true)] public void WithWidthHeightAspect(PdfRotation? rotation, int? width, int? height, bool withAspectRatio) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}_{width?.ToString() ?? "null"}x{height?.ToString() ?? "null"}_{withAspectRatio}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}_{width?.ToString() ?? "null"}x{height?.ToString() ?? "null"}_{withAspectRatio}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (rotation == null) diff --git a/src/Tests/ExceptionTests.cs b/src/Tests/ExceptionTests.cs index 0257d165..87a5b4f8 100644 --- a/src/Tests/ExceptionTests.cs +++ b/src/Tests/ExceptionTests.cs @@ -14,7 +14,7 @@ public class ExceptionTests : TestBase [TestMethod] public void ThrowsInvalidFormat() { - using var inputStream = GetInputStream(Path.Combine("Assets", "DummyImage.png")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "DummyImage.png")); Assert.ThrowsException(() => GetPageCount(inputStream)); } @@ -24,7 +24,7 @@ public void ThrowsInvalidFormat() [DataRow("Wikimedia_Commons_web.pdf")] public void ThrowsPageNotFound(string inputFile) { - using var inputStream = GetInputStream(Path.Combine("Assets", inputFile)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", inputFile)); Assert.ThrowsException(() => ToImage(inputStream, page: 80085)); } } diff --git a/src/Tests/FormFillTests.cs b/src/Tests/FormFillTests.cs index 942dc56f..684869f5 100644 --- a/src/Tests/FormFillTests.cs +++ b/src/Tests/FormFillTests.cs @@ -24,9 +24,9 @@ public void Initialize() [DataRow(false, DisplayName = "No form fill")] public void SaveWebpPageNumber(bool? withFormFill) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (withFormFill == null) @@ -43,9 +43,9 @@ public void SaveWebpPageNumber(bool? withFormFill) [DataRow(false, DisplayName = "No form fill")] public void SavePngPageNumber(bool? withFormFill) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (withFormFill == null) @@ -62,9 +62,9 @@ public void SavePngPageNumber(bool? withFormFill) [DataRow(false, DisplayName = "No form fill")] public void SaveJpegPageNumber(bool? withFormFill) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), $"hundesteuer-anmeldung_{withFormFill ?? false}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (withFormFill == null) diff --git a/src/Tests/PasswordTests.cs b/src/Tests/PasswordTests.cs index e816822c..10212cb3 100644 --- a/src/Tests/PasswordTests.cs +++ b/src/Tests/PasswordTests.cs @@ -20,7 +20,7 @@ public class PasswordTests : TestBase [DataRow("SocialPreview with password 123456 (AES-256).pdf", "123456")] public void WithCorrectPassword(string inputFile, string? password = null) { - using var inputStream = GetInputStream(Path.Combine("Assets", inputFile)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", inputFile)); var output = GetPageCount(inputStream, password: password); Assert.AreEqual(1, output, "Page count should be 1, if the password was correct."); } @@ -32,7 +32,7 @@ public void WithCorrectPassword(string inputFile, string? password = null) [DataRow("SocialPreview with password 123456 (AES-256).pdf", "Ne domina")] public void ThrowsIncorrectPassword(string inputFile, string? password = null) { - using var inputStream = GetInputStream(Path.Combine("Assets", inputFile)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", inputFile)); Assert.ThrowsException(() => GetPageCount(inputStream, password: password)); } } diff --git a/src/Tests/QueryTests.cs b/src/Tests/QueryTests.cs index 6309478b..650f97fb 100644 --- a/src/Tests/QueryTests.cs +++ b/src/Tests/QueryTests.cs @@ -14,7 +14,7 @@ public class QueryTests : TestBase [DataRow("Wikimedia_Commons_web.pdf", 20)] public void GetPageCount(string pdfFileName, int expectedPageCount) { - using var inputStream = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); Assert.AreEqual(expectedPageCount, PDFtoImage.Conversion.GetPageCount(inputStream), "Expected and actual PDF page count differs."); } @@ -46,7 +46,7 @@ public void GetPageCount(string pdfFileName, int expectedPageCount) [DataRow("Wikimedia_Commons_web.pdf", 19, 419.528f, 595.276f)] public void GetPageSize(string pdfFileName, int page, float expectedPageWidth, float expectedPageHeight) { - using var inputStream = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); var result = PDFtoImage.Conversion.GetPageSize(inputStream, page: page); @@ -60,7 +60,7 @@ public void GetPageSize(string pdfFileName, int page, float expectedPageWidth, f [DataRow("Wikimedia_Commons_web.pdf", 20)] public void GetPageSizes(string pdfFileName, int expectedSizeCount) { - using var inputStream = GetInputStream(Path.Combine("Assets", pdfFileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", pdfFileName)); var result = PDFtoImage.Conversion.GetPageSizes(inputStream); diff --git a/src/Tests/RotationTests.cs b/src/Tests/RotationTests.cs index ce2a133c..4b6438fb 100644 --- a/src/Tests/RotationTests.cs +++ b/src/Tests/RotationTests.cs @@ -19,9 +19,9 @@ public class RotationTests : TestBase [DataRow(PdfRotation.Rotate270, DisplayName = "Rotated 90 degrees counter-clockwise")] public void SaveWebpPageNumber(PdfRotation? rotation) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.webp"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.webp"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (rotation == null) @@ -40,9 +40,9 @@ public void SaveWebpPageNumber(PdfRotation? rotation) [DataRow(PdfRotation.Rotate270, DisplayName = "Rotated 90 degrees counter-clockwise")] public void SavePngPageNumber(PdfRotation? rotation) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (rotation == null) @@ -61,9 +61,9 @@ public void SavePngPageNumber(PdfRotation? rotation) [DataRow(PdfRotation.Rotate270, DisplayName = "Rotated 90 degrees counter-clockwise")] public void SaveJpegPageNumber(PdfRotation? rotation) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.jpg"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}.jpg"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (rotation == null) @@ -117,9 +117,9 @@ public void SaveJpegPageNumber(PdfRotation? rotation) [DataRow(PdfRotation.Rotate270, 200, 200, true)] public void WithWidthHeightAspect(PdfRotation? rotation, int? width, int? height, bool withAspectRatio) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}_{width?.ToString() ?? "null"}x{height?.ToString() ?? "null"}_{withAspectRatio}.png"); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Rotation", $"hundesteuer-anmeldung_{Enum.GetName(typeof(PdfRotation), rotation ?? PdfRotation.Rotate0)}_{width?.ToString() ?? "null"}x{height?.ToString() ?? "null"}_{withAspectRatio}.png"); - using var inputStream = GetInputStream(Path.Combine("Assets", "hundesteuer-anmeldung.pdf")); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", "hundesteuer-anmeldung.pdf")); using var outputStream = CreateOutputStream(expectedPath); if (rotation == null) diff --git a/src/Tests/Tests.csproj b/src/Tests/Tests.csproj index aaac8ea8..d84ab9a0 100644 --- a/src/Tests/Tests.csproj +++ b/src/Tests/Tests.csproj @@ -17,8681 +17,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - + + Always - + \..\%(RelativeDir)%(Filename)%(Extension) + diff --git a/src/Tests/TilingTests.cs b/src/Tests/TilingTests.cs index 09ce0f68..2537a332 100644 --- a/src/Tests/TilingTests.cs +++ b/src/Tests/TilingTests.cs @@ -44,9 +44,9 @@ public class TilingTests : TestBase [DataRow("Wikimedia_Commons_web.pdf", 1200, true)] public void WithDpi(string fileName, int dpi, bool? useTiling = null) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Tiling", useTiling == true ? "tiled" : "normal", GetExpectedFilename(fileName, "png", null, null, dpi, false, default, default)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Tiling", useTiling == true ? "tiled" : "normal", GetExpectedFilename(fileName, "png", null, null, dpi, false, default, default)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream = CreateOutputStream(expectedPath); if (useTiling != null) @@ -89,9 +89,9 @@ public void WithDpi(string fileName, int dpi, bool? useTiling = null) [DataRow("Wikimedia_Commons_web.pdf", 6000, 6000, true)] public void WithWidthAndHeight(string fileName, int? width = null, int? height = null, bool? useTiling = null) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Tiling", useTiling == true ? "tiled" : "normal", GetExpectedFilename(fileName, "png", width, height, null, false, default, default)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Tiling", useTiling == true ? "tiled" : "normal", GetExpectedFilename(fileName, "png", width, height, null, false, default, default)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream = CreateOutputStream(expectedPath); if (useTiling != null) @@ -154,9 +154,9 @@ public void WithWidthAndHeight(string fileName, int? width = null, int? height = [DataRow("Wikimedia_Commons_web.pdf", PdfRotation.Rotate270, true)] public void WithRotation(string fileName, PdfRotation? rotation = null, bool? useTiling = null) { - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Tiling", useTiling == true ? "tiled" : "normal", GetExpectedFilename(fileName, "png", null, null, 600, false, rotation ?? default, default)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Tiling", useTiling == true ? "tiled" : "normal", GetExpectedFilename(fileName, "png", null, null, 600, false, rotation ?? default, default)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream = CreateOutputStream(expectedPath); if (rotation != null) @@ -240,9 +240,9 @@ public void WithRotation(string fileName, PdfRotation? rotation = null, bool? us public void WithBounds(string fileName, float x, float y, float width, float height, PdfRotation? rotation = null, bool? useTiling = null) { var bounds = new RectangleF(x, y, width, height); - var expectedPath = Path.Combine("Assets", "Expected", GetPlatformAsString(), "Tiling", useTiling == true ? "tiled" : "normal", GetExpectedFilename(fileName, "png", null, null, 600, false, rotation ?? default, bounds)); + var expectedPath = Path.Combine("..", "Assets", "Expected", GetPlatformAsString(), "Tiling", useTiling == true ? "tiled" : "normal", GetExpectedFilename(fileName, "png", null, null, 600, false, rotation ?? default, bounds)); - using var inputStream = GetInputStream(Path.Combine("Assets", fileName)); + using var inputStream = GetInputStream(Path.Combine("..", "Assets", fileName)); using var outputStream = CreateOutputStream(expectedPath); if (rotation != null)