Hi Chuck,
Thanks for posting! The answer to your question is a bit complicated, depending upon how much effort you want to invest into your testing system. My assumption is that at the moment, this test is designed to run synchronously, with no parallel execution. You can read more about parallel execution here -
http://www.ncrunch.net/documentation/concepts_parallel-execution.
I find it interesting that the test would complain about the underlying database being missing. This suggests to me that you are attempting to run database tests in parallel on the same system, and you have some code as part of the test that automatically deletes/tearsdown the database on completion of the run. This would then result in one test pulling the database out from under the other tests, which would then give errors.
The quickest and easiest way to solve this problem is to disable parallel execution for the solution, using the solution-level configuration setting.
A more effective way is to use
ExclusivelyUsesAttribute to declare each database test as making use of the same resource. NCrunch will then avoid running them in parallel with each other.
The best solution is to rig up each parallel test process so it will use a different database for each process (I think this is what you were asking after). Specifying System.Diagnostics.Process.GetCurrentProcess().Id as the database name during its creation is a very effective way to do this, but you'll still need to have code that can clean up the databases after the test run completes. Because there is no reliable way for a test run to clean up after itself (i.e. it could be suddenly terminated at any time), this actually needs to be done at the start of a test run, by enumerating ALL databases on the database server using DDL, comparing this against the list of running processes on the current machine, then deleting all databases that do not have a corresponding process. This takes some effort to get up and running, but it is tremendously rewarding as database integration tests often take a long time to run, and NCrunch's parallel execution can greatly reduce the time required for an end-to-end run.