Exemple #1
0
 public void HandleTestRunStatsChange(TestRunChangedEventArgs testRunChangedArgs)
 {
     if (testRunChangedArgs?.NewTestResults != null)
     {
         TestResults.AddRange(testRunChangedArgs.NewTestResults);
         foreach (var newTestResult in testRunChangedArgs.NewTestResults)
         {
             TestResultAvailable?.Invoke(this, new VsTestResultEventArgs(newTestResult));
         }
     }
 }
        private void CaptureTestResults(IEnumerable <TestResult> results)
        {
            var testResults = results as TestResult[] ?? results.ToArray();

            TestResults.AddRange(testResults);
            if (!_testFailed && testResults.Any(result => result.Outcome == TestOutcome.Failed))
            {
                // at least one test has failed
                _testFailed = true;
                TestsFailed?.Invoke(this, EventArgs.Empty);
            }
        }
        private void CaptureTestResults(IEnumerable <TestResult> results)
        {
            var testResults = results as TestResult[] ?? results.ToArray();

            foreach (var testResult in testResults)
            {
                var index = _inProgress.FindIndex(t => t.Id == testResult.TestCase.Id);
                if (index < 0)
                {
                    continue;
                }
                _inProgress.RemoveAt(index);
            }
            TestResults.AddRange(testResults);
        }
Exemple #4
0
        public void HandleTestRunComplete(
            TestRunCompleteEventArgs testRunCompleteArgs,
            TestRunChangedEventArgs lastChunkArgs,
            ICollection <AttachmentSet> runContextAttachments,
            ICollection <string> executorUris)
        {
            if (lastChunkArgs?.NewTestResults != null)
            {
                TestResults.AddRange(lastChunkArgs.NewTestResults);
                foreach (var newTestResult in lastChunkArgs.NewTestResults)
                {
                    TestResultAvailable?.Invoke(this, new VsTestResultEventArgs(newTestResult));
                }
            }
            if (testRunCompleteArgs != null)
            {
                TestRunStatistics = testRunCompleteArgs.TestRunStatistics;
            }

            waitHandle.Set();
        }
        private void HandleTestsPrioritized <TTestCase>(object sender, TestsPrioritizedEventArgs <TTestCase> eventArgs) where TTestCase : ITestCase
        {
            for (int i = 0; i < eventArgs.TestCases.Count; i++)
            {
                int testCaseId = i;
                applicationUiExecutor.ExecuteOnUi(() =>
                {
                    var testCase = eventArgs.TestCases[testCaseId];

                    var currentTestViewModel         = TestResults.Single(x => x.FullyQualifiedName == testCase.Id);
                    currentTestViewModel.ExecutionId = testCaseId;
                });
            }

            applicationUiExecutor.ExecuteOnUi(() =>
            {
                var allTestsViewModels = TestResults.OrderBy(x => x.ExecutionId).ToList();
                TestResults.Clear();
                TestResults.AddRange(allTestsViewModels);
            });
        }