Unit Test Generator


Generates unit test code for methods in classes under test.

(32) Review
Visual Studio
2013, 2012
Download (37,907)
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Reviews (32)
Q and A (28)
Sign in to write a review
Sort by:

by GBotros | April 16 2014

by Micky D | April 15 2014

Works exactly as described. Compatible with Resharper

by BlogTroll | April 05 2014

Does exactly what it promises, setting up the plumbing and creating one test method, or a test method for EVERY public methods of a public class. Obviously not the same as the discontinued feature, but then it states that clearly.

by smarty420 | April 03 2014

People who ever developed this plugin ,please don't call yourself a programmer. This is a useless tool that does nothing . Its a shame on MS , that they can't get a back cool feature that is needed by its developer community , even after two releases of visual studio.

by Bgardner21 | March 20 2014

It would be really nice if it picked up on the InternalsVisibleTo setting, and allow you to create unit tests for internal classes in the project. Aside from that, it works well.

by bsolomon | March 20 2014

Better than nothing. All the positive ratings here must be from those
who do not know or remember the vs2010 version.

The original version would create test cases with a template call to
the method under test, AND would also allow you to create test cases
(with calling stubs) for EVERY method in a class, not just one at a time.

by AAAZ | March 09 2014


Who's idea was to remove from VS 2013 "Create Unit Test"?

This solves nothing. It does not create the auto code generated that
we enjoyed on VS 2010,12

VS 2013 Testing features has gone back in time 10 years.

by Atrejoe | March 05 2014

Thanks for restoring this functionality to Visual Studio!
Nice to haves:
- Register keyboard shortcut upon instllation, like ctrl-U(nit)-T(est)
- Add Xml comments to generated code.

by Grynchuk Anatolii | February 24 2014

bull shit :(. No comments... Just do nothing.

by TheBigFont | February 13 2014

Easy to use out of the box.

by D. Oliana | February 11 2014

by cml1 | February 01 2014

Error "Controller must have testable element property set up" when try to generate test for method in struct.
(Ugly workaround: change "struct" to "class", generate test, change to "struct" ;)

by ImadMN | January 28 2014

It has a bug when creating a test class in a C# project from a VB class.
Can you solve it, please ?

by Anatolii Grynchuk | January 09 2014

Unnecessary tool whith generating body like Assert.Faile or empty. Actually this tool does nothing for now. Whould be better to generate a method like



Assert.Fail("Not implemented");

by CAD bloke | November 13 2013

Four and nine-tenths stars.

Count me in on the chorus for wanting Internal classes and methods when InternalsVisibleTo is set. I rate this as more important than a batch test generation. I'm happy to generate tests as I need to.

For those using ReSharper, I use this naming setup so it looks sensible in the test runner:

Project name: [Project]Tests
Namespace: [Namespace].Tests
Class Name: [Class]_Tests
Method Name: [Method]Tests_go_here

by IanRelease | October 29 2013

Excellent. One thing I would like is ability to specify naming rules for the project or even choose an existing project.

by Omar Gameel Salem | October 22 2013

great tool
Thank you

by recherche | September 25 2013

The Unit Test Generator is uber-kewl (4-Star). It would be cooler (5-Star) with backward compatibility up to Visual Studio 2005 Professional Edition. Since, there are still a lot of Visual Studio 2005 Professional Edition users who use NUnit. As per http://nunit.org/ there are no further updates since NUnit 2.6.2 - October 22, 2012. I would like to replace my NUnit with the Unit Test Generator especially for Visual Studio 2005 Professional Edition, which does not include Visual Studio Test.

by Mr. INTJ | September 25 2013

Great tool. Does what it says. You saved me a lot of time and effort. I wish there was a donate button so I could send some $$ your way.

by Guido Tapia | September 10 2013

Would love to see the following features:
- Generate tests for a directory (all files recursively)
- Generate tests for internal classes and members (if InternalsVisibleTo includes the test package)
- Namespacing configuration is a bit limited. Its not possible to achieve the following:
// Class Cls in Ns project
namespace Ns.InnerNs { class Cls {... }}

// Unit test ClsTest in Ns.Tests project
namespace Ns.Tests.InnerNs { class ClsTests {...}}

So the names pace of the tests is [Project].Tests.[RemainingNamespaces].

Apart from that its a great plugin

1 - 20 of 32 Items   
Sign in to start a discussion

  • Controller must have testable element property set up
    1 Posts | Last post April 17, 2014
    • VS 2013 doesn't work. When I choose my method and right-click -> Generate Unit Test I get an error: "Controller must have testable element property set up". 
  • installed - in tools, but no generate unit test
    2 Posts | Last post April 15, 2014
    • I have VS2013 ultimate, tools/extension show I have installed, and under Test I have Configure Unit Test Generator, but no Generate Unit Test shows when I right click on class or methods. Ideas ?  I have VS 2012 installed with same issue. Is there any other way to invoke it ?? What next ?
    • After I built the project then the Generate showed up... not sure if a build is prerequisite to getting the generate enabled...
  • Cannot generate unit test in Module
    6 Posts | Last post March 02, 2014
    • As a new developer generating unit tests is outstanding!  
      But, it only works in Classes, not Modules.  Most of the non-form code in my app is in a set of modules, so this is sorely missed in VS 2013.
      I'm on W7 Pro, VS 2013 Pro, with VS 2010 Pro also installed.
      This was previously documented as bug 8675, but has returned?
    • @Dan, I just tested the v1.2 extension and it works in both classes and modules. Can you share some sample code which fails on your side, so that we can investigate?
      Bug 8675 was fixed in v1.1.
    • I should have been more specific.  The issue is that Generate Unit Test does not appear in the context menu when I right-click on a method in a Module, while it does appear when I right-click on a method in a Class.  This is also occurring in V1.2.
      Generating a unit test in a Class works fine.
    • @Dan, I just re-tested v1.2 and the feature lights up in the context menu in a public method within a module. Can you possibly record a repro so that we can investigate?
    • Hi Willy,
      I just reinstalled VS 2013 with Update 1, uninstalled and reinstalled UTG, but I still have the same problem.  If no one else has this issue, I would probably need to reformat my C drive to get it resolved.
    • Hi Willy,
      To solve a different problem, I went through my registry and removed every item I could find which referred to 'Visual Studio 10'.  Then I did a repair on VS 2013.  That fixed my other problem and also now shows Generate Unit Test in the context menu when I right-click a procedure in a module.
      All is good now.
  • Generate unit tests context menu doesn't contain list of my existing test projects
    1 Posts | Last post February 12, 2014
    • I have been using Unit Test Generator for quite some time, after I have upgraded if I try to generate unit tests from context menu, menu doesn't contain list of my existing test projects. Is this normal behavior ? Is there any way so I can "hack" my list in until you check this issue ?
  • Add Assert.Inconclusive to method body template
    1 Posts | Last post February 11, 2014
    • I would like to have the default methods be "Inconclusive", so that I can distinguish them from failed/succeeded test in the test window. 
  • Invalid manifest on VS13
    2 Posts | Last post February 02, 2014
    • When trying to install on a new installation of VS 2013 I'm getting "The extension manifest is invalid"
    • Can you please share details on VS 2013 version and SKU?
  • Does it support VS 2013 Service Pack 1
    3 Posts | Last post January 30, 2014
    • I miss the generate unit test menu item in the context menu after installing Service Pack 1 for Visual Studio 2013 Ultimate.
      Is this a known issue?
    • Disregard. It was due to the fact the class was marked as internal instead of public.
    • I'm having the same problem. Installed and will not appear on the menu. I have Vs 2013 Ultimate sp 1
  • Namespace name
    9 Posts | Last post January 03, 2014
    • The generated namespace name does not respect configured project name.
    • Josef, can you clarify why it does not respect project name and what your expectations are?
    • Freezes IDE.  I have VS update 3 and installed from Extensions and updates mgr.  I can open the ide but as soon as I open a project I get the "thinking" cursor and it never recovers.  Uninstalling (Disable still causes a freeze) this extension restores a functioning IDE.  
      The search for a quick way to create unit tests continues.
    • Reinstalled VS and all is well.
    • @Willy, I can also confirm Josef's statement.  Using the default settings (MSTest, ProjectName = [Project]Tests, Class Name = [Class]Tests, Method Name = [Method]Test...
      1.  Create new project "ClassLibrary1"
      2.  Add method "Method1"
      3.  Run "Generate Unit Test", and you get...
      Project: ClassLibrary1Tests (correct)
      Class: Class1Tests (correct)
      Namespace: ClassLibrary1.Test (incorrect, should match test project name)
      Method Name: Method1Test (correct)
      If this is intentional behaviour, then I would urge you to make the namespace a customisable option as well, since I (and many other projects I've seen) use [Project].Tests as the library name and would prefer if the namespace matched up - this is currently stopping me generating new unit tests in existing projects as they always get generated in the wrong namespace within the correct file.
    • @RichLawley, we are performing exploratory testing on feature/bug fix that allows you to configure the namespace behaviour. Hopefully this will make you and Josef smile if it makes it into v1 RTM.
    • Version 1, Build:, includes support to customise the generated namespace behaviour.
    • Hi, 
      my first question is: Where can I find a document with a description of the placeholders for the different options. I saw [Project], [Namespace], [Class], [Method]. Are there more of them and what do they exactly.
      And the second question is, how can I prevent creating sub namespaces in the unit test target Project, when I create a test of a class in an sub namespace of a project.
    • @Stephan, the known placeholders are documented in http://blogs.msdn.com/b/willy-peter_schaub/archive/2013/07/19/exploring-the-unit-test-generator-vs-extension-v1-rc.aspx and at this stage are the four you mentioned.
  • Cannot download from extensions and updates
    4 Posts | Last post December 13, 2013
    • also, I cannot figure out how to install from this page, do I need 7zip or something like that?
    • Click download which downloads a Visual Studio Extension (vsix). Which version of Visual Studio are you using?
    • Visual studio 2013 express.
      I downloaded it from this page, but couldn't figure out what to do with vsix file.
    • The Unit Test Generator extension is supported on Visual Studio Pro, Premium and Ultimate. We do not currently support VS Express.
  • Project Template
    4 Posts | Last post December 04, 2013
    • The Unit Test Generator is quite promising so far.
      I have one issue though: When a new project is implicitly created upon creation of the first test, it doesn't compile in my environment. I know exactly the adjustments I have to make to the project file. I wonder if it is possible to edit the project template.
      The obvious template was this:
      C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplates\CSharp\Test\1033\UnitTestProject
      Also 1031. But editing them hasn't changed the behaviour.
      Is there a template that I can edit?
    • Can you please elaborate on "does not compile in my environment"? What must you change to make it work?
    • I need to remove the first property group
      <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
      <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
      and change "Debug|AnyCPU" into "Debug|x86".
      That is why I think it would be convenient to have a template.
    • Great feedback, which we will add to our backlog.
1 - 10 of 28 Items