Пример #1
0
 /// <summary>
 /// Starts the process of finding all tests in an assembly.
 /// </summary>
 /// <param name="discoverer">The discoverer.</param>
 /// <param name="includeSourceInformation">Whether to include source file information, if possible.</param>
 /// <param name="discoveryMessageSink">The message sink to report results back to.</param>
 /// <param name="discoveryOptions">The options used by the test framework during discovery.</param>
 public static void Find(this ITestFrameworkDiscoverer discoverer,
                         bool includeSourceInformation,
                         IMessageSinkWithTypes discoveryMessageSink,
                         ITestFrameworkDiscoveryOptions discoveryOptions)
 {
     discoverer.Find(includeSourceInformation, MessageSinkAdapter.Wrap(discoveryMessageSink), discoveryOptions);
 }
Пример #2
0
        private IEnumerable <ITestCase> GetTestCasesFromDiscoverer(ITestFrameworkDiscoverer discoverer, ITestFrameworkDiscoveryOptions discoveryOptions)
        {
            using (discoverer)
            {
                var discoverySink = new TestDiscoverySink();

                discoverer.Find(false, discoverySink, discoveryOptions);

                return(discoverySink.GetTestCases().Result);
            }
        }
Пример #3
0
        List <ITestCase> GetTestCases(AssemblyRunInfo runInfo, ITestFrameworkDiscoverer discoverer)
        {
            string assemblyFileName = runInfo.AssemblyFileName;
            // Xunit needs the file name

            var configuration    = runInfo.Configuration;
            var discoveryOptions = TestFrameworkOptions.ForDiscovery(configuration);

            using (var sink = new TestDiscoverySink())
            {
                discoverer.Find(includeSourceInformation: false, sink, discoveryOptions);
                sink.Finished.WaitOne();

                return(sink.TestCases);
            }
        }
Пример #4
0
 /// <summary>
 /// Starts the process of finding all xUnit.net v2 tests in an assembly.
 /// </summary>
 /// <param name="includeSourceInformation">Whether to include source file information, if possible.</param>
 /// <param name="messageSink">The message sink to report results back to.</param>
 /// <param name="discoveryOptions">The options used by the test framework during discovery.</param>
 public void Find(bool includeSourceInformation, IMessageSink messageSink, ITestFrameworkDiscoveryOptions discoveryOptions)
 {
     discoverer.Find(includeSourceInformation, CreateOptimizedRemoteMessageSink(messageSink), discoveryOptions);
 }
Пример #5
0
 /// <summary>
 /// Starts the process of finding all xUnit.net v2 tests in an assembly.
 /// </summary>
 /// <param name="includeSourceInformation">Whether to include source file information, if possible.</param>
 /// <param name="messageSink">The message sink to report results back to.</param>
 /// <param name="discoveryOptions">The options used by the test framework during discovery.</param>
 public void Find(bool includeSourceInformation, IMessageSink messageSink, ITestFrameworkDiscoveryOptions discoveryOptions)
 {
     discoverer.Find(includeSourceInformation, messageSink, discoveryOptions);
 }
Пример #6
0
 /// <summary>
 /// Starts the process of finding all xUnit.net v2 tests in an assembly.
 /// </summary>
 /// <param name="includeSourceInformation">Whether to include source file information, if possible.</param>
 /// <param name="messageSink">The message sink to report results back to.</param>
 /// <param name="options">The options used by the test framework during discovery.</param>
 public void Find(bool includeSourceInformation, IMessageSink messageSink, XunitDiscoveryOptions options)
 {
     discoverer.Find(includeSourceInformation, messageSink, options);
 }
Пример #7
0
 /// <inheritdoc/>
 public void Find(bool includeSourceInformation, IMessageSink messageSink)
 {
     discoverer.Find(includeSourceInformation, messageSink);
 }