UnitTestResult Run(List <XUnitTestCase> testCases, XUnitAssemblyTestSuite rootSuite, IExecutableTest test, TestContext context, bool reportToMonitor = true) { using (var session = test.CreateExecutionSession(reportToMonitor)) { var executionListener = new RemoteExecutionListener(new LocalExecutionListener(context, testCases)); RemotingServices.Marshal(executionListener, null, typeof(IXUnitExecutionListener)); XUnitTestRunner runner = (XUnitTestRunner)Runtime.ProcessService.CreateExternalProcessObject(typeof(XUnitTestRunner), context.ExecutionContext, rootSuite.SupportAssemblies); try { runner.Execute(rootSuite.AssemblyPath, testCases.Select(tc => tc.TestInfo).ToArray(), executionListener); } finally { runner.Dispose(); } return(session.Result); } }
UnitTestResult Run (List<XUnitTestCase> testCases, XUnitAssemblyTestSuite rootSuite, IExecutableTest test, TestContext context, bool reportToMonitor = true) { using (var session = test.CreateExecutionSession (reportToMonitor)) { var executionListener = new RemoteExecutionListener (new LocalExecutionListener (context, testCases)); RemotingServices.Marshal (executionListener, null, typeof (IXUnitExecutionListener)); XUnitTestRunner runner = (XUnitTestRunner)Runtime.ProcessService.CreateExternalProcessObject (typeof(XUnitTestRunner), context.ExecutionContext, rootSuite.SupportAssemblies); try { runner.Execute (rootSuite.AssemblyPath, testCases.Select (tc => tc.TestInfo).ToArray (), executionListener); } finally { runner.Dispose (); } return session.Result; } }