My setup
CoreExtensions.Host.InitializeService();
package = new TestPackage(pathToTestDll);
builder = new TestSuiteBuilder();
suite = builder.Build(package);
And running (note that tests are the valid list of NUnitTestMethods retrieved from the suite
foreach (NUnitTestMethod t in tests)
{
try
{
var res = t.RunTest();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
I get this as the exception stack:
at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at NUnit.Core.Reflect.InvokeMethod(MethodInfo method, Object fixture, Object[] args) at NUnit.Core.TestMethod.RunTestMethod() at NUnit.Core.TestMethod.RunTestCase(TestResult testResult)
Note that t.RunTest(); does not fail rather the test just fails at running and HasError flag is set...
The nunit.core and nunit.core.interfaces are the same files in both my test package and runner package