.net - "Create Unit Tests"选择在哪里?

标签 .net unit-testing visual-studio-2012 visual-studio-2013 mstest

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

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

请参阅 Visual Studio 2010 Ultimate: enter image description here

和 Visual Studio 2012 Ultimate: enter image description here

知道为什么会这样吗?

更新:

适用于 Visual Studio 2012 和 2013 的解决方案:

微软已经承认了 here并提供 official work around patch要解决这个问题。下载、安装并享受!

最佳答案

此功能已从 VS 中删除。

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

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.

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

关于.net - "Create Unit Tests"选择在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9547055/

相关文章:

c# - Linq To SQL InsertAllOnSubmit 和 DeleteAllOnSubmit

c# - 如果使用存储过程,则对 Entity Framework Core 2.0 进行单元测试

c# - 测试类 A 中的方法是否已从类中的另一个方法调用

c++ - 如何在静态库 (Visual Studio) 中嵌入图标 (.ico)

c# - 为什么 Asp.net MVC 不能区分具有不同参数的两个 Action ?

c# - 在 .NET 1.1 中扩展密封类的干净/直观的方法是什么?

asp.net-mvc - 如何对已应用[Authorize]属性的 Controller 方法进行单元测试?

c++ - Opencv图像以较小的尺寸保存而不压缩

.net - VS 2012 在启动时创建新文件夹

c# - 如何使用 SIMD 计算数组中某个字节的出现次数?