I think you should use the content of MockFileData and create a memorystream (or some MockFileStream) for it and pass it to the StreamWriter...