Example #1
0
        // TODO: Pending on an issue with our custom PDFSharp library:
        //       https://github.com/Didstopia/PDFSharp/issues/3
        //[InlineData(SampleBookWithPasswordRemotePath)]
        public async void TestBookParsingAsync(string filePath)
        {
            // Create the book and start testing it
            PDFBook book = await PDFReader.OpenBookAsync(filePath);

            TestBook(book);
        }
Example #2
0
        private void TestBook(PDFBook book)
        {
            // Test the book and it's basic properties
            Assert.False(book == null, "Book should not be null");
            Assert.False(string.IsNullOrEmpty(book.Title), "Book title should not be null or empty");
            //Assert.False(string.IsNullOrEmpty(book.Author), "Book author should not be null or empty");

            // TODO: Once OCR has been implemented, rewrite/remove this,
            //       as pages should have content at that point
            if (book.IsOCR)
            {
                return;
            }

            // Test pages and page count
            Assert.False(book.Pages == null || book.Pages.Count == 0, "Book pages should not be null or empty");

            // Test each page recursively
            foreach (PDFPage page in book.Pages)
            {
                TestPage(page);
            }
        }
Example #3
0
        // TODO: Pending on an issue with our custom PDFSharp library:
        //       https://github.com/Didstopia/PDFSharp/issues/3
        //[InlineData(SampleBookWithPasswordRemotePath)]
        public void TestBookParsing(string filePath)
        {
            PDFBook book = PDFReader.OpenBook(filePath);

            TestBook(book);
        }