我正在尝试设置一个类别,以便可以排除构建服务器上的硬件测试:
namespace MyNamespace
{
using namespace NUnit::Framework;
[TestFixture]
[Category("RequiresHardware")]
public ref class UnitTest_SomeHardwareTests
{
...
};
}...but当我尝试使用类别时,我得到一个错误:
1>c:\projects\testing\UnitTest_MainSystem.h(14) : error C2872: 'CategoryAttribute' : ambiguous symbol
1> could be 'c:\program files (x86)\nunit 2.5.9\bin\net-2.0\framework\nunit.framework.dll : NUnit::Framework::CategoryAttribute'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.dll : System::ComponentModel::CategoryAttribute'我如何告诉它使用NUnit?
发布于 2012-09-20 18:57:14
以下两种方法适用于我:
在属性规范中显式指定完全限定的属性名称,即
[NUnit::Framework::Category("RequiresHardware")]或者,添加一个using声明来准确地指出您想要使用的CategoryAttribute:
using NUnit::Framework::CategoryAttribute;https://stackoverflow.com/questions/12510366
复制相似问题