I have data files used as input for my unit tests. These files are quite large, and I do not want to copy them every time when unit tests are performed. Tests are run without deployment. So I can just put them in a folder under my solution and ... how to get the path to my solution (or the source code of the project) when the unit test is running?
Since you can run a test project in different ways (TD.NET, Visual Studio, R #, etc.), the path used to reference the tests may change.
For this reason, I insert test files into my test assembly and get them out of there.
You can use:
Assembly.GetExecutingAssembly().Location
in your tests to get the build path containing unit tests.
Simple, make file locations customizable (and verifiable).
Then either install it in a unit test code, or install it through some configuration file.