示例#1
0
 private async Task DiscoverSourcesAsync(
     IEnumerable <string> sources,
     IMessageLogger logger,
     ITestCaseDiscoverySink discoverySink,
     SimpleTestDiscoverer testDiscoverer,
     TestConverter testConverter
     )
 => await Task.WhenAll(sources.Select(
                           source => this.DiscoverAssemblyTestsAsync(
                               source, logger, discoverySink, testDiscoverer, testConverter
                               )
                           ));
示例#2
0
        private async Task DiscoverAssemblyTestsAsync(
            string assemblyPath,
            IMessageLogger logger,
            ITestCaseDiscoverySink discoverySink,
            SimpleTestDiscoverer testDiscoverer,
            TestConverter testConverter
            )
        {
            var assemblyName = AssemblyLoadContext.GetAssemblyName(assemblyPath);
            var assembly     = AssemblyLoadContext.Default.LoadFromAssemblyName(assemblyName);

            foreach (var test in await testDiscoverer.GetTests(assembly))
            {
                discoverySink.SendTestCase(testConverter.Convert(assemblyPath, test));
            }
        }
 public TestResultConverter(TestConverter testConverter)
 {
     this.testConverter = testConverter;
 }