C# Unit Test Generation

对着背影说爱祢 提交于 2020-01-06 05:39:06

问题


I know it is possible for VS 2008 to generate unit test code to test C# classes, but I cannot find the right sequence of mouse clicks to generate the code. Any help?


回答1:


I don't think the generate unit test function of Visual Studio is available in the Professional version. You need Team Developer edition, Team Tester edition or Team Suite edition.

You may want to look into PEX instead. It works in Professional just fine.




回答2:


I have Visual Studio 2008 professional installed. I just need to right-click on a function or class name and select "Generate Unit Tests" from the popup-menu.




回答3:


For me, if I right-click a class in the editor, there's a Create Unit Tests option in the popup menu. (Near the top, just below the Organise Usings flyout.) I don't think I customised it so hopefully it's also there in the default menu layout...!




回答4:


Disclaimer I work at Typemock.

Typemock has a feature called Suggest. It analyzes you uncovered code and creates unit tests where you don't have any. You can edit the test suggestions (refactor and personalize) and then just click save.



来源:https://stackoverflow.com/questions/1934448/c-sharp-unit-test-generation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!