In VS2012, I have a bunch of (MS) unit tests that use different xml / text files, which I saved in the same folder as the test file class.
I open these files using File.OpenRead (AppDomain.CurrentDomain.BaseDirectory + "file")
If I run only one test, it works, the file is read.
If I run all the tests at once, BaseDirectory returns a different path (in TestResults / Deploy / currentdatetime / Out) and obviously cannot find the file there.
What to do?
Thanks!
source
share