I am writing some unit tests and I need to have access to an external file. I suggested that I could just put the file in my solution, mark it for copying to the output directory, and then access it through the relative path. Unfortunately, it seems that unit tests run in a strange directory.
So, instead of starting from:
[MyUnitTestProjectFolder]\bin\Release
runs from:
[MySolution]\\[TheProjectI'mTesting]\TestResults\\[MyUsername]_[MyComputerName] [DateTimeStamp]\Out
My question is: how do I configure access to external files that I need to use from my unit tests?
Please note: files are not text files. They are a proprietary database format with flat files (created from another application), so preparing these files on the fly during a test run is not possible.
file-io unit-testing visual-studio-2010 mstest
Kristrip
source share