Open
Description
I have a compiled set of .Net Framework 4.7.1 NUnit3 Tests as a DLL and would like to run them from a .Net Core 2.0 project through the NUnit.Engine.NetStandard.
What I am trying to do is:
- Point the TestPackage to the test assembly using:
TestPackage testPackage = new TestPackage(testAssemblyPaths);
- Initializing the TestEngine:
_testEngine = new TestEngine();
- Creating an instance of the TestRunner and call the Run() method:
using (ITestRunner testRunner = _testEngine.GetRunner(testPackage))
{
TestFilter categoryTestFilter = builder.GetFilter();
/*
NUnitTestEventMapper and NUnitEventSplitter are custom classes unrelated to this question,
the latter of which implements ITestEventListener.
*/
NUnitTestEventMapper nUnitTestEventMapper = new NUnitTestEventMapper();
testRunner.Run(new NUnitEventSplitter(subscribers, nUnitTestEventMapper), categoryTestFilter);
}
On Run, I'm getting the following Exception:
Exception Message - 'Could not load file or assembly 'MyTestAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'
Exception Stack Trace -
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, IntPtr ptrLoadContextBinder)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at NUnit.Engine.Drivers.NUnitNetStandardDriver.Load(String testAssembly, IDictionary`2 settings)
at NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
at NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded()
at NUnit.Engine.Runners.DirectTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
at NUnit.Engine.Runners.TestExecutionTask.Execute()
at NUnit.Engine.Runners.AggregatingTestRunner.RunTestsSequentially(ITestEventListener listener, TestFilter filter, List`1 results, Boolean disposeRunners)
at NUnit.Engine.Runners.AggregatingTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
at NUnit.Engine.Runners.MasterTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
at NUnit.Engine.Runners.MasterTestRunner.Run(ITestEventListener listener, TestFilter filter)
Should it be possible at all to create a TestPackage pointing to test assemblies using .Net Framework and .Net Core and running everything using a single .Net Standard Engine?