views:

261

answers:

2

Hi,

I'm running the NUnit tests and everything is fine as long as the required dlls are in the same directory as tests. Otherwise I get the error "Could not load file or assembly". NUnit console doesn't seem to have any switch to include default path, nor it uses system PATH variable while looking for assemblies.

The question is how to reference binaries that are in a directory other then tests itself. I don want to avoid mixing test and shipping binaries within a directory. Sure, I could copy everything/remove test dlls, but it feels hacky.

A: 

Write tests in a seperate project which references all the other projects.

Are you using Visual Studio .Net? Then you can choose to not include this project when you make a release build.

Test code should never reach production.

Gerrie Schenck
Tests are in a separate project. The problem is that we build quite a lot of binaries and want to avoid unnecessary copying, so we redirect output from all projects to one dir, say /output. Then I would like to have tests in /tests and reference binaries in /output instead of making a copy of them.
ya23
A: 

On the machine in question, create an environment variable "DEVPATH" and set the value to the path for your assemblies. Then, within nunit.exe.config, add the following within the \configuration\runtime\ section:

<developmentMode developerInstallation="true" />

Pedro