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

Generating unit test on wrong unit test project #50

Closed leandrodeopereira closed 4 years ago

leandrodeopereira commented 4 years ago

Installed product versions

Description

When creating a unit test using the UnitTestBoilerplateGenerator, it generates the unit test for the first relative path in a specified unit test project inside the solution. Not always it will be right.

For example, I have the following projects in my solution:

When generating a unit test for Something.Api project, it will generate in Something.Api.Client.UnitTests.

Steps to recreate

  1. Create the example projects: Something.Api, Something.Api.Client, Something.Api.Client.UnitTests, Something.Api.UnitTests
  2. Right-click an item in Something.Api and choose "Create Unit Test Boilerplate"

Current behavior

Right-click an item in Something.Api and choose "Create Unit Test Boilerplate" . It generates a unit in Something.Api.Client.UnitTests.

Expected behavior

Right-click an item in Something.Api and choose "Create Unit Test Boilerplate" . It generates a unit in Something.Api.UnitTests.