我安装了NUnit v2.2,按照Getting Started的提示建了bank.dll及相应的测试单元,但是在用nunit-gui测试时,提示nunit.framework.dll引用的Framework版本和我的bank.dll引用的Framework版本不一致,这是什么原因。使用v2.2.2时则提示不含TestFixture(我觉得原因是一样的)。
哪位高手碰到过这种情况,怎么解决的阿。我把nunit.framework的工程重新生成后拷贝过来的dll用还是不行,救命,急。

解决方案 »

  1.   

    建议用稳定版本  你可以设置一个断点看一看bank.dll引用的Framework和你的nunit.framework.dll是否一样
      

  2.   

    编写单元测试的时候,是一定要写TestFixture的
    http://www.microsoft.com/china/community/Column/59.mspx
    http://www.microsoft.com/china/community/program/originalarticles/techdoc/nunit.mspx
      

  3.   

    what versions of .net framework are on your version? what version of .net framework is bank.dll compiled in?try to modify nunit-gui.exe.config, see the documentation:
    http://www.nunit.org/installation.htmlIf multiple versions of the .NET framework are installed, the configuration files nunit-gui.exe.config and nunit-console.exe.config control which one of them is selected when running the gui and console runner respectively. As originally installed, that order is .NET 1.1, .NET 2.0 and .NET 1.0. To change which version is used, simply change the order of the elements in the config files. The nunit-gui About Box shows the framework version currently being used.