microsoft / UnitTestBoilerplateGenerator

An extension for Visual Studio that generates a unit test boilerplate from a given class, setting up mocks for all dependencies. Supports NUnit, Visual Studio Test, Moq and SimpleStubs.
MIT License
158 stars 51 forks source link

NullReferenceException when attempting to generate test class #41

Closed johnmbaughman closed 5 years ago

johnmbaughman commented 5 years ago

Installed product versions

Description

NullReferenceException when attempting to generate test class. image

Project implements Caliburn.Micro as the IoC framework. Test project uses Moq and xUnit. Class has a single constructor with parameters; two are dynamic, others are instantiated objects and interfaces. Project is .NET Framework 4.6.2

Steps to recreate

  1. Select class to generate test class from
  2. Ensure proper testing frameworks and project are selected.
  3. Click Create Unit Test Class button
  4. Exception dialog should now be displayed.

Current behavior

Exception dialog displays and no test class is generated.

Expected behavior

No exception dialog displayed and test class is generated.

RandomEngy commented 5 years ago

Can you try with Visual Studio 2017 15.9.1? The extension was majorly broken in 15.9.0.

johnmbaughman commented 5 years ago

Awesome! That one worked! The other one didn't; I'll send you the project and packages.config files on that issue.