[英]how to write to Test or Debug tab of Visual Studio with xUnit
[英]XUnit Asserting Exceptions In Debug Mode In Visual Studio
我认为您无法运行此代码是否正确:
Assert.Throws<FormatException>(()=>
{
int test;
test = int.Parse("forty two");
});
在调试模式? 它将引发错误,并且该错误将不会被捕获。
Assert.Throws<FormatException>
因此测试将失败。
看一看, 如何防止预期的异常中断调试测试运行?
您的Visual Studio设置可能是错误的,不是xunit
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.