可以在VS2008中的一个TestProject的你组单元测试? [英] Can you group unit tests within a single testproject in VS2008?

查看:237
本文介绍了可以在VS2008中的一个TestProject的你组单元测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你能在VS2008中的一个TestProject的组单元测试?

Can you group unit tests within a single testproject in VS2008?

例如 - 测试1和测试2属于组A. TEST4和TEST5属于B组。

For instance - test1 and test2 belongs to group A. Test4 and test5 belongs to group B.

我不希望B组的测试运行,除非我明确地选择它们。 这是因为并不是所有的测试都应该被包括在自动测试

I don't want the tests in group B to run unless I explicitly select them. This is because not all tests are supposed to be included in the automatic testing.

编辑:
改写第二部分。
我可以通过使用测试列表编辑器创建组。是否有可能只选择一种或两种这些基团也可以设置为自动测试?

EDIT :
Rephrasing second part.
I can create groups by using the test list editor. Is it possible to select only one or two of these groups to be set up for automatic testing?

例如。我想A组为自动化测试运行,每天晚上和B组进行手动测试运行。

E.g. I want group A to run as automated tests every night and group B is for manual test runs.

推荐答案

在测试视图窗口中有一个分组依据组合框。您可以在类名,命名空间,描述等。

In the test view window there is a 'Group By' combobox. You can group tests on class name, namespace, description etc.

因此​​,通过使用结合一些属性,它们都可以在你的测试方法,如类别您可以在运行测试时会更有选择性。

So by using that in combination with some attributes which are available on your test methods, such as Category you can be more selective when running tests.

编辑:这仅仅是一个解决方案时,手动运行测试。也许类似的解决方案是availble的自动测试,你选择要运行的某一类或某一空间只测试。

this is only a solution when manually running the tests. Maybe a similar solution is availble with automatic testing, where you choose to run only tests of a certain Category or in a certain namespace.

这篇关于可以在VS2008中的一个TestProject的你组单元测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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