Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio unit testing - how to access external files?

I have data files used as input to my unit tests. These files are quite big and I don't want to copy them each time unit tests are executed. Tests are executed without deployment. So I can just put them into folder under my solution, and... how to obtain path to my solution (or test project source code) when unit test is executing?

like image 731
skevar7 Avatar asked Oct 01 '09 08:10

skevar7


1 Answers

Because you can run a test project in different ways (TD.NET, Visual Studio, R# etc.), the path used to reference the tests can change.

For this reason, I embed test needed files in my test assembly and draw them out from there.

like image 199
Daniel Elliott Avatar answered Oct 12 '22 23:10

Daniel Elliott