public static async Task ShouldGetCorrectFileNameWithUnicodeChars() { using var pdfAValidator = new PdfAValidator(); Assert.True(File.Exists("./TestPdfFiles/NoPdfWithUnicodeChars-üåäö.pdf")); var result = await pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles/NoPdfWithUnicodeChars-üåäö.pdf"); Assert.Contains("NoPdfWithUnicodeChars-üåäö.pdf", result.Jobs.Job.Item.Name); }
public static async Task ShouldDetectNonCompliantPdfAWhenCheckingWrongFlavour() { using var pdfAValidator = new PdfAValidator(); Assert.True(File.Exists("./TestPdfFiles/FromLibreOffice.pdf")); var result = await pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles/FromLibreOffice.pdf", "-f 2b"); Assert.False(result.Jobs.Job.ValidationReport.IsCompliant); Assert.True(result.Jobs.Job.ValidationReport.ProfileName == "PDF/A-2B validation profile"); }
public static async Task ShouldGetDetailedReportFromPdfA() { using var pdfAValidator = new PdfAValidator(); Assert.True(File.Exists("./TestPdfFiles/FromLibreOffice.pdf")); var result = await pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles/FromLibreOffice.pdf"); Assert.True(result.Jobs.Job.ValidationReport.IsCompliant); Assert.True(result.Jobs.Job.ValidationReport.ProfileName == "PDF/A-1A validation profile"); Assert.StartsWith(@"<?xml version=""1.0"" encoding=""utf-8""?>", result.RawOutput); }
public static async Task ShouldGetDetailedReportFromNonCompliantPdfAMissingFont() { using var pdfAValidator = new PdfAValidator(); Assert.True(File.Exists("./TestPdfFiles/FontsNotEmbedded.pdf")); var result = await pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles/FontsNotEmbedded.pdf"); Assert.False(result.Jobs.Job.ValidationReport.IsCompliant); Assert.True(result.Jobs.Job.ValidationReport.ProfileName == "PDF/A-1B validation profile"); Assert.Contains(result.Jobs.Job.ValidationReport.Details.Rule, _ => _.Clause == "6.3.5"); }
public static async Task ShouldGetDetailedReportFromNonCompliantPdfA() { using var pdfAValidator = new PdfAValidator(); Assert.True(File.Exists("./TestPdfFiles/FromLibreOfficeNonPdfA.pdf")); var result = await pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles/FromLibreOfficeNonPdfA.pdf"); Assert.False(result.Jobs.Job.ValidationReport.IsCompliant); Assert.True(result.Jobs.Job.ValidationReport.ProfileName == "PDF/A-1B validation profile"); Assert.InRange(result.Jobs.Job.ValidationReport.Details.FailedRules, 1, 20); Assert.Contains(result.Jobs.Job.ValidationReport.Details.Rule, _ => _.Clause == "6.7.3"); }
public static async Task ShouldParseButNotValidateRegularPdfWithValidateOffArgument() { using var pdfAValidator = new PdfAValidator(); Assert.True(File.Exists("./TestPdfFiles/FromLibreOfficeNonPdfA.pdf")); var result = await pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles/FromLibreOfficeNonPdfA.pdf", "-o"); var taskResult = result.Jobs.Job.TaskResult; Assert.Equal(string.Empty, taskResult.Type); Assert.Equal(string.Empty, taskResult.ExceptionMessage); }
public static async Task ShouldValidateFolderWithExpectedResult() { using var pdfAValidator = new PdfAValidator(); var result = await pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles", ""); Assert.Equal("6", result.BatchSummary.TotalJobs); Assert.Equal(6, result.Jobs.AllJobs.Count); Assert.Equal("1", result.BatchSummary.ValidationReports.Compliant); Assert.Equal("2", result.BatchSummary.ValidationReports.NonCompliant); Assert.Equal("3", result.BatchSummary.ValidationReports.FailedJobs); }
public static async Task ShouldGetDetailedReportFromEncryptedPdf() { using var pdfAValidator = new PdfAValidator(); Assert.True(File.Exists("./TestPdfFiles/Encrypted.pdf")); var result = await pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles/Encrypted.pdf"); var taskResult = result.Jobs.Job.TaskResult; Assert.True(taskResult.IsExecuted); Assert.False(taskResult.IsSuccess); Assert.Equal("PARSE", taskResult.Type); Assert.Contains("appears to be encrypted", taskResult.ExceptionMessage); }