简体   繁体   English

使用NUnit在VS2012中调试而不抛出异常?

[英]Debugging in VS2012 with NUnit without throwing exceptions?

I have NUnit running into VS2012 with the NUnit Test Adapter and I can do Run All tests fine, but if I want to Debug All Tests every time I hit an Assert it throws an exception. 我使用NUnit测试适配器将NUnit运行到VS2012中,我可以运行所有测试,但是如果我想在每次遇到Assert时调试所有测试,它会抛出异常。 How do I make it not throw exceptions for Asserts? 如何让它不会抛出Asserts的异常? Am I doing something horribly wrong? 我做错了什么吗?

When the debugger is attached, failed asserts throw exceptions. 附加调试器时,失败的断言抛出异常。 This is intended behaviour. 这是预期的行为。 No need to be alarmed. 无需惊慌。

You can stop Visual Studio from stopping at certain exceptions, by going into Debug -> Exceptions... and unchecking all or some items in the appropriate group, from the column "Thrown" in the "Break when an exception is:" box. 可以停止Visual Studio在某些异常处停止,方法是进入Debug - > Exceptions ...并从“Break a an exception is:”框中的“Thrown”列中取消选中相应组中的所有或部分项目。

“例外”对话框

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM