Hi All, This is probably a noob question that I will get slated for but here goes... Sorry for the length tried to keep it as short as possible.
BackGround
I'm working on tidying up a code base that I inherited in my new role. So I'm introducing tests as I work on sections/Bugs/New Features. One of these features is an invoice printing function the invoice is generated from a crystal report rpt file. There was already a small wrapper for the underlying Crystal functions, I'm just wanting to test it out and make sure we produce the files as required.
Problems Firstly, I know that anything using file IO should not be part of unit testing but can I cover this with Integration Tests / System tests? Do I just run the wrapper with preloaded data and check it spits a file out? Can I interrogate the PDF programatically and make sure details are correct?
I have also tried to mock out some of the IO so that I could unit test the wrapper but here I have problems with moq not liking the crystal ReportDocument class. Also I had to really change the structure of the Class to allow for testing, should I really be doing this (sort of feel like I should) but making privates public just so I can insert test data seems a bit wrong.
I haven't posted code as this is more a theoretical debate at the minute... I'd love to get some code coverage but not sure if I'm over thinking things can somebody please advise me on these type of situations.
Thanks ever so much.