Search code examples
unit-testingvisual-studio-2017asp.net-core-2.0asp.net-core-webapitestcase

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


"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!


Solution

  • 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).

    enter image description here

    HTH :)