“创建单元测试"在哪里?选择? [英] Where is the "Create Unit Tests" selection?

查看:20
本文介绍了“创建单元测试"在哪里?选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了新的 Visual Studio 2012 Ultimate.

I have installed the new Visual Studio 2012 Ultimate.

我用我的解决方案创建了一个测试项目,它包含一些默认的单元测试.但是,右键单击新方法不再显示创建单元测试"上下文菜单.

I have created a Test Project with my solution and it contains some default unit tests. However right clicking on new Methods doesn't show the "Create Unit Tests" context menu any longer.

参见 Visual Studio 2010 Ultimate:

和 Visual Studio 2012 Ultimate:

知道为什么会这样吗?

更新:

Visual Studio 2012 和 2013 解决方案:

微软已经承认它此处 并提供 官方解决补丁来修复它.下载、安装和享受!

Microsoft has acknowledged it here and offers an official work around patch to fix it. Download, install and Enjoy!

推荐答案

此功能是从 VS 中删减的.

This feature was cut from VS.

http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/08/what-s-new-in-visual-studio-11-beta-unit-testing.aspx

生成单元测试向导 - 在 VS2010 中,您可以右键单击方法,我们会在您的测试中生成单元测试项目.这个向导与 MS-Test 非常紧密地耦合并且依赖于像 Private Accessors 这样的功能来完成它的工作,所以它被削减了.我们正在这里探索替代方案,但没有任何好的解决方案

Generate Unit Test Wizard – In VS2010 you could right click on a method in your code and we would generate a unit test into your test project. This wizard was very tightly coupled to MS-Test and depended on features like Private Accessors to do its work, so it was cut. We are exploring alternatives here, but don’t have any good solutions yet.

EDIT 有一个解决方法:http://blogs.msdn.com/b/malaysia/archive/2013/02/20/right-click-create-unit-tests.aspx

这篇关于“创建单元测试"在哪里?选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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