public void ShouldThrowExceptionWhenPasswordIsNull() { using (var file = new TemporaryFile("foo.pdf")) { Assert.Throws <ArgumentNullException>("password", () => PdfInfo.Create(file.FullName, null)); } }
public void ShouldReturnTheNumberOfPagesForPasswordProtectedFile() { if (!Ghostscript.IsAvailable) { return; } var pdfInfo = PdfInfo.Create(Files.Coders.PdfExamplePasswordOriginalPDF, "test"); Assert.Equal(4, pdfInfo.PageCount); }
public void ShouldReturnTheNumberOfPages() { if (!Ghostscript.IsAvailable) { return; } var pdfInfo = PdfInfo.Create(Files.Coders.SamplePDF); Assert.Equal(2, pdfInfo.PageCount); }
public void ShouldThrowExceptionWhenFileIsPng() { if (!Ghostscript.IsAvailable) { return; } var exception = Assert.Throws <MagickDelegateErrorException>(() => PdfInfo.Create(Files.CirclePNG)); Assert.Single(exception.RelatedExceptions); Assert.Contains("Error: /syntaxerror in pdfopen", exception.RelatedExceptions.First().Message); }
public void ShouldThrowExceptionWhenFileNameIsEmpty() { Assert.Throws <ArgumentException>("fileName", () => PdfInfo.Create(string.Empty)); }
public void ShouldThrowExceptionWhenFileNameIsNull() { Assert.Throws <ArgumentNullException>("fileName", () => PdfInfo.Create((string)null)); }
public void ShouldThrowExceptionWhenFileIsPng() { Assert.Throws <MagickDelegateErrorException>(() => PdfInfo.Create(Files.CirclePNG)); }