示例#1
0
        public void RunTests(IEnumerable <string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            var tracer   = new MessageLoggerTracer(frameworkHandle);
            var executor = new Executor(tracer, new AssertionDetectorPlugin());
            var sink     = new DiscoverySink();

            _testDiscoverer.DiscoverTests(sources, null, frameworkHandle, sink, _cancellationTokenSource.Token);

            if (_cancellationTokenSource.IsCancellationRequested)
            {
                return;
            }

            ExecuteTests(sink.Tests, frameworkHandle, executor, _cancellationTokenSource.Token).Wait();
        }
示例#2
0
        public void RunTests(IEnumerable <TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            var tracer     = new MessageLoggerTracer(frameworkHandle);
            var executor   = new Executor(tracer, new AssertionDetectorPlugin());
            var sink       = new DiscoverySink();
            var testsArray = tests.ToArray();

            var sources = testsArray.Select(x => x.Source).Distinct();

            _testDiscoverer.DiscoverTests(sources, null, frameworkHandle, sink, _cancellationTokenSource.Token);

            if (_cancellationTokenSource.IsCancellationRequested)
            {
                return;
            }

            ExecuteTests(testsArray, frameworkHandle, executor, _cancellationTokenSource.Token).Wait();
        }