Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Visual Studio Unit Test to copy a file to the tests area? (which works when running/debugging)

BACKGROUND: I have a sqlite file that is marked as COPY in it's properties. When I debug my WinForms application in VS2008 (or run it) it does the right thing and copy it to the debug/run area.

QUESTION: When I run unit tests (using VS2008 unit tests) it is not performing this copy. Anyone know how to get this working? So that my sqlite database file will be copied across before VS2008 tries to run the unit tests

like image 275
Greg Avatar asked Oct 13 '09 23:10

Greg


1 Answers

You must either docorate your test with the DeploymentItemAttribute or configure deployment using the .testrunconfig file.

See this answer for more details.

like image 55
Mark Seemann Avatar answered Oct 05 '22 20:10

Mark Seemann