Esempio n. 1
0
        /// <summary>
        /// Gets aggregate outcome.
        /// </summary>
        /// <param name="results">Results.</param>
        /// <returns>Aggregate outcome.</returns>
        private UTF.UnitTestOutcome GetAggregateOutcome(List <UTF.TestResult> results)
        {
            // In case results are not present, set outcome as unknown.
            if (!results.Any())
            {
                return(UTF.UnitTestOutcome.Unknown);
            }

            // Get aggregate outcome.
            var aggregateOutcome = results[0].Outcome;

            foreach (var result in results)
            {
                aggregateOutcome = UnitTestOutcomeExtensions.GetMoreImportantOutcome(aggregateOutcome, result.Outcome);
            }

            return(aggregateOutcome);
        }
Esempio n. 2
0
        public void GetMoreImportantOutcomeShouldReturnFailedIfBothOutcomesAreFailed()
        {
            var resultOutcome = UnitTestOutcomeExtensions.GetMoreImportantOutcome(UTF.UnitTestOutcome.Failed, UTF.UnitTestOutcome.Failed);

            Assert.AreEqual(UTF.UnitTestOutcome.Failed, resultOutcome);
        }
Esempio n. 3
0
        public void GetMoreImportantOutcomeShouldReturnInconclusiveIfTwoOutcomesArePassedAndInconclusive()
        {
            var resultOutcome = UnitTestOutcomeExtensions.GetMoreImportantOutcome(UTF.UnitTestOutcome.Passed, UTF.UnitTestOutcome.Inconclusive);

            Assert.AreEqual(UTF.UnitTestOutcome.Inconclusive, resultOutcome);
        }