I have been playing with the new Nhibernate bits, and working through the tutorial here, now he uses MbUnit, and NUnit which are great frameworks for testing, but I wanted to use the test framework supplied with visual studio.
The problem comes when the test is looking for the Hibernate configuration file, which the ms test framework cannot find, because the test runs in its own folder, and not in the debug bin folder as the other frameworks do, so we need to have a way of copying the file to this directory which could quite easily change!
Reading the MSDN help I discovered that the LocalTestRun.testrunconfig file has a deployment option, which can specify a file or directory, sadly the file can only be an executable or dll. So I simply chose the debug bin directory of the project that contained the hibernate configuration file and ensured that the hibernate.cfg.xml file was set to copy if newer, or copy always. and it all worked.
The only problem with this is that I am not only copying the hibernate file, but also ALL the dlls etc in the project bin folder, this makes the startup time for the tests slightly longer, but it does give me a chance to get a sip of tea before continuing with the refactoring 🙂