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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user