我已经安装了新的 Visual Studio 2012 Ultimate。
我已经使用我的解决方案创建了一个测试项目,它包含一些默认的单元测试。但是,右键单击新方法不再显示“创建单元测试”上下文菜单。
请参阅 Visual Studio 2010 Ultimate:
和 Visual Studio 2012 Ultimate:
知道为什么会这样吗?
更新:
适用于 Visual Studio 2012 和 2013 的解决方案:
微软已经承认了 here并提供 official work around patch要解决这个问题。下载、安装并享受!
最佳答案
此功能已从 VS 中删除。
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/