On 6/01/2012 9:38, Vahid Nasiri wrote:
Hello,
Is it possible to write unit tests for programs based on the iText or iTextSharp? If yes, what should be tested? because the result is a binary file and it's a highly visual medium...
Are there any samples available about this subject?

There are a number of third party tools that "test" PDFs on a structural level:
- checking objects such as the outline tree,
- counting the pages in the page tree,
- comparing the syntax of the content stream,...

We don't use these because:
- two PDFs that are identical to the human eye can have a different structure/syntax
- we use iText to check the specific syntax where we expect problems.

There may also be third party tools that "test" PDFs by rendering them at a specific resolution, and then compare pixel per pixel. We don't have any experience with those, but we have this
on our product road map.

If you want to see how we currently test iText, take a look at the tests in the SVN repository: For instance: https://itext.svn.sourceforge.net/svnroot/itext/trunk/itext/src/test/
There are more tests in the XML Worker project.
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to