Пример #1
0
        public void TestPdf()
        {
            var pdfOriginal = PathUtilities.GetAdjacentFile("sample.pdf");
            var pdf         = PathUtilities.GetAdjacentFile("temp.pdf");

            File.Copy(pdfOriginal, pdf, true);
            Approvals.VerifyPdfFile(pdf);
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
        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);
        }