How to design a unit test for generating a PDF document?

I'm late to the party with regards to using unit testing... trying to figure best practices and the such. My question is, given a class which is responsible for generating a PDF (or Doc/Html/Xml/etc.), how would I go about testing the final output file is correct? I figure a text based file (xml), I could just see if the strings match, but what about a binary file (pdf)? Should I just check against a MD5 hash? Should I even be testing this?

Thanks in advance.

13
задан chad 29 October 2010 в 17:04
поделиться