0

I have a project where I have packaged the NUnit3 Framework along with some others into an internal dll. However when I reference the dll in a project I unable to get TEST to show in the Visual Studio 15, Test Explorer.

Inside the project classes I am able to use NUnit.Framework methods. I think the issue has to do with the NUnitTestAdapter3, not able to find the reference to the NUnit3Framework. Because after I remove the Nunit3 Framework from my DLL and just add NUnit3 Framework and NUnit 3 Test Adapter to my project, I am able to get the test to show. So I am guessing there is disconnect between NUnit3 Test Adapter package and my DLL which contains NUnit3 Framework..

Is there a way to be able to have the NUnit3 Test Adapter reference the NUnit3 Framework in my custom DLL to get these to show?

1 Answers1

0

The problem is not in the adapter but in the NUnit Test Engine, which it uses. The engine has code to determine what framework is in use. That code actually depends on the name of the framework.

Under NUnit V2, we tried to load whatever assembly you pointed to. But with NUnit 3, the engine has to figure out what framework is in use, since it supports multiple frameworks through extensions.

There's currently no way around this. You need to use the actual nunit.framework assembly.

Charlie
  • 12,928
  • 1
  • 27
  • 31
  • Thanks for this info. Is it possible to modify the NUnit Test Engine code to use my custom dll's nunit.framework? I am just now starting to Review the nunit.engine solution..to try and handle this. I see the references in the Drivers and that is about it.. – SomeEngineer89 Jun 07 '18 at 02:36
  • It's certainly possible. See https://github.com/nunit/nunit-console/blob/master/src/NUnitEngine/nunit.engine/Drivers/NUnit3DriverFactory.cs#L42 – Charlie Jun 08 '18 at 06:30
  • However, you would also need to substitute your modified copy of the engine for the one installed by the NUnit 3 VS adapter. – Charlie Jun 08 '18 at 06:33