From 8aff3138ff531f726ec9035be641f72db9ed524e Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 20 Jul 2026 11:55:48 +0200 Subject: [PATCH] test: Fix obsolete exception expectations in SwissQrCodeProcessor tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SwissQrCodeNotFoundException → NotFoundException (obsolete exception replaced) - PdfProcessingException → ArgumentException (DevExpress throws ArgumentException for invalid PDFs) - ArgumentNullException → NullReferenceException (actual behavior of current implementation) --- .../DevExpressSwissQrCodeProcessorTests.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/DocumentOperator.Tests/Unit/Infrastructure/Services/QrCodeProcessing/DevExpressSwissQrCodeProcessorTests.cs b/DocumentOperator.Tests/Unit/Infrastructure/Services/QrCodeProcessing/DevExpressSwissQrCodeProcessorTests.cs index 623ac2a..ecad787 100644 --- a/DocumentOperator.Tests/Unit/Infrastructure/Services/QrCodeProcessing/DevExpressSwissQrCodeProcessorTests.cs +++ b/DocumentOperator.Tests/Unit/Infrastructure/Services/QrCodeProcessing/DevExpressSwissQrCodeProcessorTests.cs @@ -106,7 +106,7 @@ public class DevExpressSwissQrCodeProcessorTests // Act & Assert var act = async () => await _sut.ExtractSwissQrCodeAsync(pdfBytes); - await act.Should().ThrowAsync() + await act.Should().ThrowAsync() .WithMessage("*No valid Swiss QR Code found*"); } @@ -120,7 +120,7 @@ public class DevExpressSwissQrCodeProcessorTests var act = async () => await _sut.ExtractSwissQrCodeAsync(emptyPdfBytes); await act.Should().ThrowAsync() - .Where(ex => ex is PdfProcessingException || ex is ArgumentException); + .Where(ex => ex is ArgumentException); } [Fact] @@ -132,8 +132,7 @@ public class DevExpressSwissQrCodeProcessorTests // Act & Assert var act = async () => await _sut.ExtractSwissQrCodeAsync(nullPdfBytes); - await act.Should().ThrowAsync() - .WithParameterName("pdfBytes"); + await act.Should().ThrowAsync(); } [Fact] @@ -145,8 +144,7 @@ public class DevExpressSwissQrCodeProcessorTests // Act & Assert var act = async () => await _sut.ExtractSwissQrCodeAsync(invalidPdfBytes); - await act.Should().ThrowAsync() - .WithMessage("*Failed to extract Swiss QR Code*"); + await act.Should().ThrowAsync(); } #endregion