public void TestPdf() { var pdfOriginal = PathUtilities.GetAdjacentFile("sample.pdf"); var pdf = PathUtilities.GetAdjacentFile("temp.pdf"); File.Copy(pdfOriginal, pdf, true); Approvals.VerifyPdfFile(pdf); }
public void TestPdf_Mismatch() { try { Approvals.VerifyPdfFile(@"D:\ApprovalTestForReports\ApprovalTestForReports\ApprovalFiles\pdf.pdf"); } finally { message = new ApprovalMismatchException(@"D:\ApprovalTestForReports\ApprovalTestForReports\ApprovalFiles\pdf.pdf", "my exception").Received; } }
public void TestPdf_New() { var pdf = PathUtilities.GetAdjacentFile("new_temp.pdf"); using (var fileStream = File.Create(pdf)) using (var writer = new PdfWriter(fileStream)) using (var pdfDocument = new PdfDocument(writer)) { pdfDocument.SetTagged(); var document = new Document(pdfDocument); document.Add(new Paragraph("Test")); document.Close(); } Approvals.VerifyPdfFile(pdf); File.Delete(pdf); }