Inheritance: System.MarshalByRefObject, ICrossDomainLogger
Exemple #1
0
 public void DiscoverTests(IEnumerable<string> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
 {
     foreach(var source in sources) {
         var xDomainSink = new TestAdapterLogger(logger, source);
         xDomainSink.OnBeginTest += (_, e) => discoverySink.SendTestCase(e.TestCase);
         CrossDomainConeRunner.WithProxyInDomain<ConeTestAdapterProxy, int>(string.Empty,
             new [] { source, },
             proxy => proxy.DiscoverTests(source, xDomainSink)
         );
     }
 }
Exemple #2
0
 public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
 {
     foreach(var source in tests.GroupBy(x => x.Source, x => x.FullyQualifiedName)) {
         var xDomainSink = new TestAdapterLogger(frameworkHandle, source.Key);
         xDomainSink.OnSuccess += (_, e) => frameworkHandle.RecordResult(new TestResult(e.TestCase) { Outcome = TestOutcome.Passed, Duration = e.Duration, });
         xDomainSink.OnPending += (_, e) => frameworkHandle.RecordResult(new TestResult(e.TestCase) { Outcome = TestOutcome.Skipped, Duration = e.Duration });
         xDomainSink.OnFailure += (_, e) => frameworkHandle.RecordResult(new TestResult(e.TestCase) {
             Outcome = TestOutcome.Failed,
             Duration = e.Duration,
             ErrorMessage = e.ErrorMessage,
             ErrorStackTrace = e.ErrorStackTrace,
         });
         CrossDomainConeRunner.WithProxyInDomain<ConeTestAdapterProxy, int>(string.Empty,
             new [] { source.Key, },
             proxy => proxy.RunTests(source.Key, xDomainSink, source.ToArray())
         );
     }
 }