我在nUnit 3中遇到了一个令人沮丧的问题.我相信这个问题也发生在nUnit 2上,但它现在更频繁地发生.
在VS2015编译后,我会在构建后在测试资源管理器中突然失去一半的单元测试.一个干净的构建或视觉工作室重新启动将修复它,但这在一个大型解决方案中真的很烦人.我还没有确定为什么一些测试会继续出现而其他测试消失 – 项目文件的比较显示它们使用相同的库和项目设置.
我正在使用nUnit3和nUnit3测试适配器作为扩展以及nuget包安装(仅尝试nuget包,测试不显示)
最佳答案 此特定问题已在适配器版本3.0.9中修复.请参阅问题
126和
131.
来自查理普尔的遗产:
I discovered that we were getting a COM exception from VS when calling
RecordEnd on Explicit Tests for which no RecordStart was called. This
does not seem to actually cause a problem for earlier VS products but
appears to do so for VS2015. I’m catching the exception and displaying
a message. This seems to eliminate the intermittent failures of VS2015
to complete the execution of tests but I’m not certain the problem
won’t pop up again.In any case, it still seems like a good idea that we don’t propogate
exceptions back to NUnit from the listener.