views:

25

answers:

1

I'm hopefully going to be deploying an application soon, and I find it strange that I would have to include nunit.framework.dll. After all, the user is not going to need to run unit tests! So the only thing I can think of is that there is some way of configuring my solution for Debug and Release, such that Debug references NUnit, while Release does not. I've never seen anything like this before in VS200anything. What is everyone else here doing to preclude the need to deploy the NUnit framework along with your apps?

+5  A: 

Typically you would create two projects: the "main" project to be released, and a separate project containing only unit tests. That way, you don't distribute your tests in any way.

Mark Rushakoff
ah, I see... I've always put the unit tests in the project, so that I get in the habit of running while I am developing. So do you create a test project within the project that needs to be tested, and pair it with a solution / metaproject that has all of those projects in it? Or do you create one project that has unit test classes for each of the assemblies that needs testing?
Dave
@Dave: It's ultimately a matter of personal preference, but the "norm" as far as I've seen would be to do things in pairs. `FooLib` would be with `FooLibTests` and `BarLib` would be with `BarLibTests`; **not** `FooLib`, `BarLib`, and `EverythingTests`.
Mark Rushakoff
@Mark: thanks for the advice, I'll definitely start rearranging all of my projects to reflect this approach.
Dave