nunit / nunit-vs-adapter

Runs NUnit V2 tests inside the Visual Studio 2012 or later Test Explorer window.
MIT License
50 stars 43 forks source link

Tests are not displaying in 2015 VS test window when referencing a library in a Program Files (x86)/program/bin location #172

Open M-Eber opened 6 years ago

M-Eber commented 6 years ago

ENVIRONMENT: Windows 10 in a Virtual Machine Visual Studio 2015 Version 14.0.25421.03 Update 3 NUnit VS Adapter - first 2.1.1 now 2.1.2-a001 installed as a VSIX Machine login in with one ID VS login with with Admin ID that has no network access

SOLUTION: Project 1 is a micro kernel of our UI component we interface with Project 2 is a stub of the framework for our UI component we interface with this project contains 2 tests in it Project 3 contains all of our application tests (over 1800 tests) The Solution is targeting the 4.6.2 framework and all are built with the Any CPU setting.

ISSUE: When I build the solution the two tests from Project 2 are visible in the Test Explorer. None of the tests in Project 3 show in the Test Explorer.

When I bring up the NUnit 2.5.10.11092 test window I can see all of the tests in the tree view but when I try running tests from there I get an exception: JMPS.B2.MicroTest.TestCase.WriteCartridge.CartridgeTypes.MissionRegionDataNUnit (TestFixtureSetUp): SetUp : System.IO.FileNotFoundException : Could not load file or assembly 'Moq, Version=4.0.10827.0, Culture=neutral, PublicKeyToken=69f491c39445e920' or one of its dependencies. The system cannot find the file specified.

I located a test case that does NOT use Moq and all tests within that module run without problems.

I created a stub project that mimicked the original one but have not found the magic formula to keep the tests from showing. This includes adding Moq to the tests.

So the next thing I found was the NUnit UI could not run a set of tests that had no Moq usage and found that (believe it or not) it references a library in the program files location. Once I added it to my stub the tests in the 3rd library disappeared from the Test Explorer.