views:

23

answers:

1

Can't figure out why my nunit tests fail when i call the .dll files individually however when i call the below .nunit file through nunit-console-x86.exe

I suspect it has something to do with the config file. Some of these test require configuration information from this config file. Some do not, and it seems that the ones that don't, pass.

Is there way to tell nunit-console.exe to use the configuration file when it loads the individual dll? nothing in the command line parameters suggest that this is possible which leaves me with defining a new config section with just the subset of tests i want to run.

<NUnitProject>
  <Settings activeconfig="Debug" />
  <Config name="Debug" appbase="..\UnitTest" configfile="Local.config" binpathtype="Auto">
      <assembly path=".\bin\Debug\UnitTest.dll" />
      <assembly path=".\bin\Debug\DBUnitTests.dll"/>
      <assembly path=".\bin\Debug\Processors.dll"/>
  </Config>
  <Config name="Release" binpathtype="Auto">
    <assembly path=".\bin\Release\UnitTest.dll" />
  </Config>
</NUnitProject>
A: 

If you put your configuration in app.config and modify the NUnit project to use that instead, it should work in both situations.

When running the nunit-console-x86.exe it will try to load [MyAssemblyName].dll.config which should be created by VS from app.config at compile time.

James O'Sullivan
Ah! of course! Many thanks!
Beta033