测试在Visual Studio则成功独立,失败的设置 [英] Testing in Visual Studio Succeeds Individually, Fails in a Set

查看:168
本文介绍了测试在Visual Studio则成功独立,失败的设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Visual Studio中运行我的测试个人,他们都通过没有问题。然而,当我运行所有的人一下子一些通有的失败。我试图把以1秒的暂停在每个测试方法之间没有成功。

任何想法?在此先感谢您的帮助......

解决方案

这可能是因为你有一些共享的数据。检查中的类在使用中,这意味着一个测试静态成员变量设置一个值,导致随后的测试失败。

您也可以调试单元测试。根据您所使用的框架,你应该能够运行的框架工具,调试启动应用程序传递路径编译的程序集作为参数。<​​/ P>

When I run my tests in Visual Studio individually, they all pass without a problem. However, when I run all of them at once some pass and some fail. I tried putting in a pause of 1 second in between each test method with no success.

Any ideas? Thanks in advance for your help...

解决方案

It's possible that you have some shared data. Check for static member variables in the classes in use that means one test sets a value that causes a subsequent test to fail.

You can also debug unit tests. Depending on the framework you're using, you should be able to run the framework tool as a debug start application passing the path to the compiled assembly as a parameter.

这篇关于测试在Visual Studio则成功独立,失败的设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆