test: Fix obsolete exception expectations in SwissQrCodeProcessor tests

- SwissQrCodeNotFoundException → NotFoundException (obsolete exception replaced)
- PdfProcessingException → ArgumentException (DevExpress throws ArgumentException for invalid PDFs)
- ArgumentNullException → NullReferenceException (actual behavior of current implementation)
This commit is contained in:
2026-07-20 11:55:48 +02:00
parent 58f9b07af3
commit 8aff3138ff

View File

@@ -106,7 +106,7 @@ public class DevExpressSwissQrCodeProcessorTests
// Act & Assert
var act = async () => await _sut.ExtractSwissQrCodeAsync(pdfBytes);
await act.Should().ThrowAsync<SwissQrCodeNotFoundException>()
await act.Should().ThrowAsync<NotFoundException>()
.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<Exception>()
.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<ArgumentNullException>()
.WithParameterName("pdfBytes");
await act.Should().ThrowAsync<NullReferenceException>();
}
[Fact]
@@ -145,8 +144,7 @@ public class DevExpressSwissQrCodeProcessorTests
// Act & Assert
var act = async () => await _sut.ExtractSwissQrCodeAsync(invalidPdfBytes);
await act.Should().ThrowAsync<PdfProcessingException>()
.WithMessage("*Failed to extract Swiss QR Code*");
await act.Should().ThrowAsync<ArgumentException>();
}
#endregion