public IList <TestCase> Convert(NUnitResults discoveryResults, string assemblyPath) { if (discoveryResults == null) { return(new List <TestCase>()); } AssemblyPath = assemblyPath; var timing = new TimingLogger(Settings, TestLog); if (Settings.DiscoveryMethod != DiscoveryMethod.Legacy) { TestRun = ConvertXml(discoveryResults); } var nunitTestCases = discoveryResults.TestCases(); // As a side effect of calling TestConverter.ConvertTestCase, // the converter's cache of all test cases is populated as well. // All future calls to convert a test case may now use the cache. if (Settings.DiscoveryMethod == DiscoveryMethod.Legacy) { converterForXml = new TestConverterForXml(TestLog, AssemblyPath, Settings); foreach (XmlNode testNode in nunitTestCases) { loadedTestCases.Add(converterForXml.ConvertTestCase(new NUnitEventTestCase(testNode))); } TestLog.Info( $" NUnit3TestExecutor discovered {loadedTestCases.Count} of {nunitTestCases.Count} NUnit test cases using Legacy discovery mode"); } else { converter = new TestConverter(TestLog, AssemblyPath, Settings, this); var isExplicit = TestRun.IsExplicit; var testCases = RunnableTestCases(isExplicit); foreach (var testNode in testCases) { loadedTestCases.Add(converter.ConvertTestCase(testNode)); } var msg = isExplicit ? "Explicit run" : "Non-Explicit run"; TestLog.Info( $" NUnit3TestExecutor discovered {loadedTestCases.Count} of {nunitTestCases.Count} NUnit test cases using Current Discovery mode, {msg}"); } timing.LogTime("Converting test cases "); return(loadedTestCases); IEnumerable <NUnitDiscoveryTestCase> RunnableTestCases(bool isExplicit) { IEnumerable <NUnitDiscoveryTestCase> result; if (isExplicit || !Settings.DesignMode) { result = TestRun.TestAssembly.AllTestCases; } else { result = TestRun.TestAssembly.RunnableTestCases; } return(result); } }