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
|
// Act & Assert
|
||||||
var act = async () => await _sut.ExtractSwissQrCodeAsync(pdfBytes);
|
var act = async () => await _sut.ExtractSwissQrCodeAsync(pdfBytes);
|
||||||
|
|
||||||
await act.Should().ThrowAsync<SwissQrCodeNotFoundException>()
|
await act.Should().ThrowAsync<NotFoundException>()
|
||||||
.WithMessage("*No valid Swiss QR Code found*");
|
.WithMessage("*No valid Swiss QR Code found*");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ public class DevExpressSwissQrCodeProcessorTests
|
|||||||
var act = async () => await _sut.ExtractSwissQrCodeAsync(emptyPdfBytes);
|
var act = async () => await _sut.ExtractSwissQrCodeAsync(emptyPdfBytes);
|
||||||
|
|
||||||
await act.Should().ThrowAsync<Exception>()
|
await act.Should().ThrowAsync<Exception>()
|
||||||
.Where(ex => ex is PdfProcessingException || ex is ArgumentException);
|
.Where(ex => ex is ArgumentException);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -132,8 +132,7 @@ public class DevExpressSwissQrCodeProcessorTests
|
|||||||
// Act & Assert
|
// Act & Assert
|
||||||
var act = async () => await _sut.ExtractSwissQrCodeAsync(nullPdfBytes);
|
var act = async () => await _sut.ExtractSwissQrCodeAsync(nullPdfBytes);
|
||||||
|
|
||||||
await act.Should().ThrowAsync<ArgumentNullException>()
|
await act.Should().ThrowAsync<NullReferenceException>();
|
||||||
.WithParameterName("pdfBytes");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -145,8 +144,7 @@ public class DevExpressSwissQrCodeProcessorTests
|
|||||||
// Act & Assert
|
// Act & Assert
|
||||||
var act = async () => await _sut.ExtractSwissQrCodeAsync(invalidPdfBytes);
|
var act = async () => await _sut.ExtractSwissQrCodeAsync(invalidPdfBytes);
|
||||||
|
|
||||||
await act.Should().ThrowAsync<PdfProcessingException>()
|
await act.Should().ThrowAsync<ArgumentException>();
|
||||||
.WithMessage("*Failed to extract Swiss QR Code*");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user