Where is the “Create Unit Tests” selection?

前端 未结 9 1371
情歌与酒
情歌与酒 2020-11-30 19:25

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 clickin

9条回答
  •  佛祖请我去吃肉
    2020-11-30 19:47

    The menu item is still in place, but for unknown reasons it's invisible in the code editor. But you can use visual studio commands to run unit test wizard. The command you need is

    EditorContextMenus.CodeWindow.CreateUnitTests
    

    Open Command Window and type the command there. Or type an alias command as follows

    alias ut EditorContextMenus.CodeWindow.CreateUnitTests
    

    and assign the alias to run command faster.

    Another way to run the wizard is keyboard shortcut. In Visual Studio open

    Tools -> Options -> Environment -> Keyboard
    

    Type "createunit" in "Show commands containing" text box to filter out CreateUnitTests command, select it. Choose "Text Editor" in "Use new shortcut in" combo, and press shortcut you want in "Press shortcut keys" text field (e.g., Ctrl+T, Ctrl+C). Finally, press Assign button. Enjoy!

提交回复
热议问题