开发者

NUNIT Fails individual dlls but works fine with .nunit file

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>


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜