My team and I are working on an application that is stored in BitBucket with Visual Studio 2015 being our primary IDE. Our application's unit tests fail when the DataSource attribute is used, but pass when it is not.
One thing I've noticed is that when the DataSource attribute is used, the working directory for the tests (obtained via the System.Environment.CurrentDirectory property as well as the AppDomain.CurrentDomain.SetupInformation.ApplicationBase property) is:
TestResuts\[generated directory name]\Out
The working directory when there is no DataSource is the project's configured output path: 'bin\Debug'. This is why the tests cannot find the DataSource files - though they are set to Copy always in the file properties, they are being copied to my bin\Debug directory and not my TestResults/.../Out directory.
Here's the oddest part - we do not have a Settings file for the project and this just started happening recently. So a new working directory was not configured and we did not change this intentionally.
Why would the DataSource attribute change the executing directory, and not copy over the file indicated in the attribute c'tor?
Is there any other reason you can think of that this may be happening?
Thanks!