posted on Thursday, October 04, 2007 11:17 PM by scotts

project/solution prep

Some solution/project setup stuff that I normally put in place when starting a new project...
Folder structure:
  • bin (all projects under src\app build here, but not test projects)
  • docs
  • lib
    • custom (in house stuff)
    • common (nibernate, log4net, castle, etc.)
  • script (any dev script stuff, maybe build related, maybe sql script, maybe ruby/rake tasks)
  • src
    • app
      • Proj1
      • Proj2
    • test
      • Proj1.Test
      • Proj2.Test
      • TestRunner
  • tools
    • nunit
    • rhinomocks, etc.
Once the folder structure is ready, I add a TestRunner project (and make it the startup project in vs) to the test folder. It only has one purpose; a proxy to launch NUnit. To wire this up, in the TestRunner project/compile tab under "start external program" add this: tools\nunit\nunit.exe
Then I create a nunit project file that should be named the same as the runner project. So, in this case I would create a TestRunner.nunit file that lists the projects to be tested. In this case it might look like this:
<NUnitProject>
<Settings activeconfig="Debug" />
<Config name="Debug" binpathtype="Auto">
<assembly path="bin\Debug\Proj1.Test.dll" />
<assembly path="bin\Debug\Proj2.Test.dll" />
</Config>
</NUnitProject>
To get the test project's dll's in the TestRunner's bin\Debug, I just reference them in the TestRunner project. Alternatively, you could just reference thier respective build paths directly in this config file.

Then add a config file to the TestRunner project named the same as the Project and the nunit projet file (without the .vbproj and .nunit respectively of course). - in this case TestRunner.config.
Nunit will load a config file with the same name as the project file. So, you could also get along with naming them NunitTests.nunit and NUnitTests.config respectively.

Comments

# re: project/solution prep @ Monday, October 08, 2007 2:51 PM

Nice breakdown, It is always good to get into a routine with things like this, never have to wonder what you called the tools folder this time etc. Also, nice to see you blogging again.
Andy

Andreas