tags:

views:

14

answers:

1

In MonoDevelop, at least, I find that nunit tests launch with a CurrentDirectory of the bin directory. There's no apparent run option to change that.

Is there some nunit-y nice way to locate data files, or should I just set an environment variable in the run configuration?

+1  A: 

Don't have a direct answer to your question but was through this problem quite a few times before; usually using one or a combination of options below:

  1. put external resources folders into the configuration file and load them on the test start. There is a nice technique for doing this described here: Config files and NUnit tests

  2. shadow copy my test resource\data files after successful build into the unit test's bin folder. VS macro can make this task quite easy if you hold your resources within the solution tree.

  3. have my test resources compiled into an assembly or a set of assemblies and reference it in the unit test. There is a blog post on this topic here: Testing with external files

hope this helps

serge_gubenko