Exemplo n.º 1
0
        public TrxObjectModel.TestOutcome ToOutcome(ObjectModel.TestOutcome rockSteadyOutcome)
        {
            TrxObjectModel.TestOutcome outcome = TrxObjectModel.TestOutcome.Failed;

            switch (rockSteadyOutcome)
            {
            case ObjectModel.TestOutcome.Failed:
                outcome = TrxObjectModel.TestOutcome.Failed;
                break;

            case ObjectModel.TestOutcome.Passed:
                outcome = TrxObjectModel.TestOutcome.Passed;
                break;

            case ObjectModel.TestOutcome.Skipped:
            case ObjectModel.TestOutcome.None:
            case ObjectModel.TestOutcome.NotFound:
                outcome = TrxObjectModel.TestOutcome.NotExecuted;
                break;

            default:
                Debug.Fail("Unexpected Outcome.");
                break;
            }

            return(outcome);
        }
Exemplo n.º 2
0
        public void WriteTestResult(TextWriter output, VsTestOutcome outcome, Xunit.ExecutionSummary summary)
        {
            if (endTime == DateTime.MinValue)
            {
                endTime = DateTime.UtcNow;
            }

            using (var trx = new TrxWriter(output))
            {
                trx.WriteStartDocument(
                    testRunId: Guid.NewGuid(),
                    testRunName: startTime.ToString(CultureInfo.InvariantCulture),
                    testRunUser: "");

                trx.WriteTimes(creationTime, queuingTime, startTime, endTime);

                // Write results
                if (testResults.Count > 0)
                {
                    trx.WriteStartTestResults();
                    foreach (var pair in testResults)
                    {
                        trx.WriteTestResult(pair.Key, pair.Value);
                    }
                    trx.WriteEndTestResults();
                }

                // Write Test Definitions
                if (testResults.Count > 0)
                {
                    trx.WriteStartTestDefinitions();
                    foreach (var pair in testResults)
                    {
                        trx.WriteTestDefinition(pair.Key, pair.Value);
                    }
                    trx.WriteEndTestDefinitions();
                }

                // Write Test Entries
                if (testResults.Count > 0)
                {
                    trx.WriteStartTestEntries();
                    foreach (var pair in testResults)
                    {
                        trx.WriteTestEntry(pair.Key, pair.Value);
                    }
                    trx.WriteEndTestEntries();
                }

                trx.WriteResultSummary(outcome, summary);

                trx.WriteEndDocument();
            }
        }
Exemplo n.º 3
0
        public void RecordEnd(VsTestCase testCase, VsTestOutcome outcome)
        {
            switch (outcome)
            {
            case VsTestOutcome.Passed:
                Interlocked.Increment(ref passed);
                break;

            case VsTestOutcome.Failed:
                Interlocked.Increment(ref failed);
                break;

            case VsTestOutcome.Skipped:
                Interlocked.Increment(ref skipped);
                break;

            case VsTestOutcome.NotFound:
            case VsTestOutcome.None:
                Interlocked.Increment(ref inconclusive);
                break;
            }
        }
Exemplo n.º 4
0
 public long this[Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome testOutcome]
 {
     get { return(0); }
 }