17

How do you generate "Smart Unit Tests*" with Visual Studio 2015 Ultimate Preview?

*Microsoft's S. Somasegar announced "Smart Unit Tests" (Under the heading 'productivity') for Visual Studio 2015. This feature, based on Pex, uses code analysis to generate unit tests.

Dan Sorensen
  • 11,403
  • 19
  • 67
  • 100
  • I can't find docs on it yet, but it appears that it works in C# by right clicking on a class or method name. I can't find it in VB.Net... probably not implemented for VB? – Dan Sorensen Nov 12 '14 at 20:43

2 Answers2

14

Here's the link to msdn documentation: Generate smart unit tests for your code

Arun M
  • 1,452
  • 8
  • 13
  • 1
    The documentation link you provided is useful, exactly what I needed. For those who want the TLDR version from the docs: "2. Right-click in a method in your code and choose Smart Unit Tests to generate unit tests for all the code paths in your method." – Dan Sorensen Nov 13 '14 at 11:49
  • I just discovered the "smart Unit Tests" option is not available from directly within a unit test project. Once I right-clicked on a method in another project, I could see the option. – Alex Dresko Nov 13 '14 at 19:00
  • Alex: yes, this "smart test" option is available from the target class / method, not the unit test project. This feature will auto-generate unit tests for the target method and place them into a unit test project. – Dan Sorensen Nov 17 '14 at 17:03
  • Does anyone know if xUnit will be supported in VS 2015 RC ? – khorvat Jul 13 '15 at 06:51
7

As of VS2015 Ultimate Preview we have not enabled this for VB.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
pvlakshm
  • 1,365
  • 7
  • 7