I am trying to use test development for an application that needs to read a lot of data from disk. The problem is that the data is organized in the file system into a somewhat complex directory structure (and not in my mistake). The methods I'm testing will need to see that a large number of files exist in several different directories to complete these methods.
The solution I'm trying to avoid is simply having a known folder on the hard drive with all the data. There are several reasons for this approach: one of the reasons is that if we want to run unit tests on another computer, we will have to copy a large amount of data onto it.
I could also generate dummy files in the installation method and clear them in the teardown method. The problem is that it would be painful to write code to replicate an existing directory structure and upload a large number of dummy files to these directories.
I understand how to perform unit test I / O, but how can I use unit test to use this script?
Edit: I will not really need to read the files. An application will need to analyze the directory structure and determine which files exist in it. And this is a large number of subdirectories with a large number of files.
source
share