What I've had pretty good luck with is just including
all my test (NUnit) classes in the assembly that I'm
testing, without a separate project. I put them all in a
subdirectory called "test", then in
the formal build, I just don't include the contents of
the "test" directory in the build for
a release build.
Unfortunately, there's no good way to do that inside
VS.NET, since I haven't been able to find any way to
include different sets of files per build configuration.
But if you're using an external build tool like NAnt, it
saves a lot of hassle creating extra projects, and you
don't have to worry so much about references in you test
classes.
Patrick,
When putting the tests in the same assembly as the
"unit" that your testing is risky. You
are no longer treating it as a black box. This may start
affecting the design of your tests.
All in all, I'd say not to put the tests in the same
assembly as the code under test, unless you have an
incontravertible reason to do so.