title: Writing unit tests with QTestLib
body: <p>this is my first step into the world on unit-testing so please be patient. I'm writing a Qt 4.8.1 C++ program and as test framework I'm using the integrated QTestLib. I should test a class that inhrerits from a base one and that loads a certain XML file to read and parse it later with a function that will return a C++ class object with the xml values that I can retrieve and set via set/get functions. The class in the constructor instantiate a QFile object and in the readXml function I use it to parse with the QXmlStreamReader the file. What's the best way to test all this class with unit-tests? I don't see how I could bypass the file-read operation to inject a own string representing the file content. Or should I use as test content a different ad-hoc XML file?</p>