如何在Visual Studio 2012 Professional中连续运行单元测试?

时间:2021-03-19 16:38:08

Visual Studio 2012 added a "Run tests after build" button in the Unit Test Explorer, but it seems that option is not available in the Professional edition. In fact, my "Unit Test Explorer" is just called "Test Explorer", and doesn't have that button at all:

Visual Studio 2012在单元测试资源管理器中添加了“在构建后运行测试”按钮,但似乎该选项在专业版中不可用。事实上,我的“单元测试资源管理器”只是被称为“测试资源管理器”,根本没有该按钮:

如何在Visual Studio 2012 Professional中连续运行单元测试?

Are there any extensions which can replace this missing feature? Something that integrates with the existing test explorer UI would be ideal. (Free options are also preferred, since if I could convince my corporate overlords to shell out for VS Ultimate/Premium, this wouldn't be an issue anyway)

有没有可以取代这个缺失功能​​的扩展?与现有测试资源管理器UI集成的东西将是理想的。 (免费选项也是首选,因为如果我可以说服我的公司领主为VS Ultimate / Premium打败,那么这不会是一个问题)

4 个解决方案

#1


27  

I remapped my F6 key to TestExplorer.RunAllTests instead of the default of Build.BuildSolution

我将我的F6键重新映射到TestExplorer.RunAllTests而不是默认的Build.BuildSolution

Build.BuildSolution gets remapped to Ctrl-Shift-B when you do that.

当你这样做时,Build.BuildSolution会重新映射到Ctrl-Shift-B。

It works well because now my F6 reflex RunAllTests saves any modified files, builds my solution and runs my unit tests.

它运行良好,因为现在我的F6反射RunAllTests保存任何修改过的文件,构建我的解决方案并运行我的单元测试。

The only thing I had to change is my window layout so that I can see the Test Explorer Window, that way I know if any tests failed.

我唯一需要更改的是我的窗口布局,以便我可以看到测试资源管理器窗口,这样我知道是否有任何测试失败。

Updating the answer with a link to a blog I wrote about this

通过我写的博客链接更新答案

#2


20  

The "Run Tests After Build" and "Profile Test" features are available in Premimum and Ultimate editions of Visual Studio 2012.

Visual Studio 2012的Premimum和Ultimate版本中提供了“运行测试后构建”和“配置文件测试”功能。

#3


8  

NCrunch is not free but it's well worth the money and superior to any and all test running features in Visual Studio, regardless of edition.

NCrunch不是免费的,但它非常值得花钱,并且优于Visual Studio中的任何和所有测试运行功能,无论版本如何。

#4


5  

You could also have a look at http://www.continuoustests.com/ aka Mighty Moose.

你也可以看看http://www.continuoustests.com/又名Mighty Moose。

It's not quite as slick as NCrunch, but it is free.

它不像NCrunch那么光滑,但它是免费的。

#1


27  

I remapped my F6 key to TestExplorer.RunAllTests instead of the default of Build.BuildSolution

我将我的F6键重新映射到TestExplorer.RunAllTests而不是默认的Build.BuildSolution

Build.BuildSolution gets remapped to Ctrl-Shift-B when you do that.

当你这样做时,Build.BuildSolution会重新映射到Ctrl-Shift-B。

It works well because now my F6 reflex RunAllTests saves any modified files, builds my solution and runs my unit tests.

它运行良好,因为现在我的F6反射RunAllTests保存任何修改过的文件,构建我的解决方案并运行我的单元测试。

The only thing I had to change is my window layout so that I can see the Test Explorer Window, that way I know if any tests failed.

我唯一需要更改的是我的窗口布局,以便我可以看到测试资源管理器窗口,这样我知道是否有任何测试失败。

Updating the answer with a link to a blog I wrote about this

通过我写的博客链接更新答案

#2


20  

The "Run Tests After Build" and "Profile Test" features are available in Premimum and Ultimate editions of Visual Studio 2012.

Visual Studio 2012的Premimum和Ultimate版本中提供了“运行测试后构建”和“配置文件测试”功能。

#3


8  

NCrunch is not free but it's well worth the money and superior to any and all test running features in Visual Studio, regardless of edition.

NCrunch不是免费的,但它非常值得花钱,并且优于Visual Studio中的任何和所有测试运行功能,无论版本如何。

#4


5  

You could also have a look at http://www.continuoustests.com/ aka Mighty Moose.

你也可以看看http://www.continuoustests.com/又名Mighty Moose。

It's not quite as slick as NCrunch, but it is free.

它不像NCrunch那么光滑,但它是免费的。