/// <summary>
        /// Handles the Run Complete event from a parallel proxy manager
        /// </summary>
        public override void HandleTestRunComplete(
            TestRunCompleteEventArgs testRunCompleteArgs,
            TestRunChangedEventArgs lastChunkArgs,
            ICollection <AttachmentSet> runContextAttachments,
            ICollection <string> executorUris)
        {
            var parallelRunComplete = HandleSingleTestRunComplete(testRunCompleteArgs, lastChunkArgs, runContextAttachments, executorUris);

            if (parallelRunComplete)
            {
                // TODO : use TestPluginCache to iterate over all IDataCollectorAttachments
                {
                    var coverageHandler = new CodeCoverageDataAttachmentsHandler();
                    Uri attachementUri  = coverageHandler.GetExtensionUri();
                    if (attachementUri != null)
                    {
                        var coverageAttachments = runDataAggregator.RunContextAttachments
                                                  .Where(dataCollectionAttachment => attachementUri.Equals(dataCollectionAttachment.Uri)).ToArray();

                        foreach (var coverageAttachment in coverageAttachments)
                        {
                            runDataAggregator.RunContextAttachments.Remove(coverageAttachment);
                        }

                        ICollection <AttachmentSet> attachments = coverageHandler.HandleDataCollectionAttachmentSets(new Collection <AttachmentSet>(coverageAttachments));
                        foreach (var attachment in attachments)
                        {
                            runDataAggregator.RunContextAttachments.Add(attachment);
                        }
                    }
                }

                var completedArgs = new TestRunCompleteEventArgs(this.runDataAggregator.GetAggregatedRunStats(),
                                                                 this.runDataAggregator.IsCanceled,
                                                                 this.runDataAggregator.IsAborted,
                                                                 this.runDataAggregator.GetAggregatedException(),
                                                                 this.runDataAggregator.RunContextAttachments,
                                                                 this.runDataAggregator.ElapsedTime);

                // Add Metrics from Test Host
                completedArgs.Metrics = this.runDataAggregator.GetAggregatedRunDataMetrics();

                HandleParallelTestRunComplete(completedArgs);
            }
        }
Exemplo n.º 2
0
 public CodeCoverageDataAttachmentsHandlerTests()
 {
     coverageDataAttachmentsHandler = new CodeCoverageDataAttachmentsHandler();
 }
Exemplo n.º 3
0
 public CodeCoverageDataAttachmentsHandlerTests()
 {
     mockProgressReporter           = new Mock <IProgress <int> >();
     coverageDataAttachmentsHandler = new CodeCoverageDataAttachmentsHandler();
 }