Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Exception 如何在C++/什么是IT测试?_Exception_Testing_Nunit_C++ Cli_Expected Exception - Fatal编程技术网

Exception 如何在C++/什么是IT测试?

Exception 如何在C++/什么是IT测试?,exception,testing,nunit,c++-cli,expected-exception,Exception,Testing,Nunit,C++ Cli,Expected Exception,你是如何做到这一点的: [Test, ExpectedException( typeof(ArgumentOutOfRangeException) )] void Test_Something_That_Throws_Exception() { throw gcnew ArgumentOutOfRangeException("Some more detail"); } C++中的P>…(C的例子)据我所见,对于nUng. < P>的C++实现没有任何类型()函数,为了避免任何人在寻找它

你是如何做到这一点的:

[Test, ExpectedException( typeof(ArgumentOutOfRangeException) )]
void Test_Something_That_Throws_Exception()
{
    throw gcnew ArgumentOutOfRangeException("Some more detail");
}

C++中的P>…(C的例子)据我所见,对于nUng.</P> < P>的C++实现没有任何类型()函数,为了避免任何人在寻找它的过程中四处寻找,这里给出了解决方案:

[Test, ExpectedException( ArgumentOutOfRangeException::typeid )]
void Test_Something_That_Throws_Exception()
{
     throw gcnew ArgumentOutOfRangeException("Some more detail");
}
只需使用异常:-)的
::typeid