/// <inheritdoc/> public List <TestCaseDescriptor> GetTestCaseDescriptors(List <ITestCase> testCases, bool includeSerialization) { var callbackContainer = new DescriptorCallback(); Action <List <string> > callback = callbackContainer.Callback; if (defaultTestCaseDescriptorProvider == null) { if (AppDomain.HasAppDomain) { try { AppDomain.CreateObject <object>(TestFrameworkAssemblyName, "Xunit.Sdk.TestCaseDescriptorFactory", includeSerialization ? RemoteDiscoverer : null, testCases, callback); if (callbackContainer.Results != null) { return(callbackContainer.Results.Select(x => new TestCaseDescriptor(x)).ToList()); } } catch (TypeLoadException) { } // Only be willing to eat "Xunit.Sdk.TestCaseDescriptorFactory" doesn't exist } defaultTestCaseDescriptorProvider = new DefaultTestCaseDescriptorProvider(RemoteDiscoverer); } return(defaultTestCaseDescriptorProvider.GetTestCaseDescriptors(testCases, includeSerialization)); }
/// <inheritdoc/> public List <TestCaseDescriptor> GetTestCaseDescriptors(List <ITestCase> testCases, bool includeSerialization) { var callbackContainer = new DescriptorCallback(); Action <List <string> > callback = callbackContainer.Callback; if (defaultTestCaseDescriptorProvider == null) { if (appDomain.HasAppDomain) { try { appDomain.CreateObject <object>(testFrameworkAssemblyName, "Xunit.Sdk.TestCaseDescriptorFactory", includeSerialization ? discoverer : null, testCases, callback); if (callbackContainer.Results != null) { return(callbackContainer.Results.Select(x => new TestCaseDescriptor(x)).ToList()); } } catch { } } defaultTestCaseDescriptorProvider = new DefaultTestCaseDescriptorProvider(discoverer); } return(defaultTestCaseDescriptorProvider.GetTestCaseDescriptors(testCases, includeSerialization)); }