How to generate unit test cases in VS 2017 .net core project?

梦想与她 提交于 2019-12-07 08:58:55

问题


"Create Unit Tests" context menu option is missing in Visual Studio 2017 for .Net core project?

I read some articles saying that "Create Unit Tests" context menu option is removed in VS2017/Core/x64 config. But those were old articles. So, wanted to check if this option is available now? If not, do we have any other alternatives (extensions) to generate the test cases? If so, kindly let me know the steps.

I am working on VS 2017/.NetCore 2.0 project.

Appreciate your help!


回答1:


Perhaps you've found a solution already. For those, still looking for one:

...This issue is expected to be resolved in 15.8 release timeframe so unfortunately, create unit test functionality for .NET Core projects would not be available in the upcoming 15.7 release.

-- quoted from the posted issue (see Sercan's comment).

Until then I use Unit Test Boilerplate Generator (see the picture below).

HTH :)



来源:https://stackoverflow.com/questions/47760377/how-to-generate-unit-test-cases-in-vs-2017-net-core-project

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