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

Incorrect testing framework detected and selected (xUnit) #40

Closed johnmbaughman closed 5 years ago

johnmbaughman commented 5 years ago

Installed product versions

Description

Extension detects Visual Studio as test framework when xUnit is referenced.

Steps to recreate

  1. Create an xUnit test project
  2. Reference xUnit in the project
  3. Click the extension menu
  4. Dialog shows "Detected: Visual Studio" and selects the Visual Studio test framework image

Current behavior

Detects and selects incorrect test framework

Expected behavior

Detect and select the correct test framework

RandomEngy commented 5 years ago

I can't reproduce the issue. Can you try with Visual Studio 15.9.1? The extension was severely broken for me on 15.9.0. If it's still happening, can you share the .csproj file that the detection is failing on?

johnmbaughman commented 5 years ago

Here are the project and package.config files.

UnitTestBoilerplateGenerator_Issue_40.zip

RandomEngy commented 5 years ago

Looks like it was working in .NET Core projects but not .NET Framework projects. Updated to look for "xunit.core" as well as "xunit" references. Fix is in 1.9.12 .

Rate it on the Visual Studio Marketplace if you like the extension: https://marketplace.visualstudio.com/items?itemName=RandomEngy.UnitTestBoilerplateGenerator

johnmbaughman commented 5 years ago

That worked. Now to fix the Assert.Fail() that doesn't exist in xUnit... ;)

I will go and rate this. It's awesome and saves a bunch of time.

RandomEngy commented 5 years ago

In 1.9.13 I changed to use Assert.True(False) for xUnit.