Beispiel #1
0
        public override Task <RunSummary> RunAsync(IMessageSink diagnosticMessageSink, IMessageBus messageBus, object[] constructorArguments, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)
        {
            TestTraceListener.Ensure();
            MessageBusOverride messageBusOverride = new MessageBusOverride(messageBus)
                                                    .AddAfterStartingBeforeFinished(new ExecuteBeforeAfterAttributesMessageBusInjection(Method, TestMethod.TestClass.Class));

            var testMethodArguments = GetTestMethodArguments();
            var runner = new TestCaseRunner(this, DisplayName, SkipReason, constructorArguments, testMethodArguments, messageBus, aggregator, cancellationTokenSource);

            if (ThreadType == ThreadType.UI)
            {
                return(UIThreadHelper.Instance.Invoke(runner.RunAsync));
            }

            messageBusOverride.AddAfterStartingBeforeFinished(new VerifyGlobalProviderMessageBusInjection());
            return(ThreadType == ThreadType.Background ? Task.Run(() => runner.RunAsync()) : runner.RunAsync());
        }
Beispiel #2
0
 protected override Task <RunSummary> RunAsyncOverride(IMessageSink diagnosticMessageSink, MessageBusOverride messageBus, object[] constructorArguments, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)
 {
     messageBus.AddAfterStartingBeforeFinished(new VerifyGlobalProviderMessageBusInjection());
     return(TestCase.RunAsync(diagnosticMessageSink, messageBus, constructorArguments, aggregator, cancellationTokenSource));
 }