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

Using "Import Project" in the test csproj (embedding the test framework in props) stops auto detection #54

Closed generik0 closed 4 years ago

generik0 commented 4 years ago

Installed product versions

Description

Looks like after VS16.6.0 update that the boilerplate:

image

Steps to recreate

  1. Create a central project props file
  2. import the props file to the test csproj
  3. Try to generate a test using boiler plate

image

Current behavior

It cannot "collect" the test and mock framework from the project import

Expected behavior

The auto discover still works.

OR, is there an attribute or something we can add to the CSPROJ so it discovers the framework + sub?

Thanks for WONDERFUL extension

RandomEngy commented 4 years ago

Just released 2.4.5, which should fix your issue. I added a step to check the references on the loaded project in the Visual Studio API, which catches references loaded by props files.

Give the extension a nice review if you like it!