6

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

Greg
  • 34,042
  • 79
  • 253
  • 454
  • or you could just add a post build event in debug mode doing the copy (probably not what you're looking for though...) – Locksfree Oct 13 '09 at 23:59
  • This is a similar question to this http://stackoverflow.com/questions/1541096/visual-studio-unit-tests-loading-resources-in-the-project – HitLikeAHammer Oct 13 '09 at 23:39
  • I'm finding that my file is going to "Project1_UnitTests\bin\Debug" whereas the test is trying to find it under "TestResults\Username_PCName_datetime\Out"..??? – Greg Oct 14 '09 at 07:18

1 Answers1

8

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

See this answer for more details.

Community
  • 1
  • 1
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736