Esempio n. 1
0
        public TestResultSummaryViewModel(TestSummaryItem summaryItem, PipelineConfiguration pipelineConfiguration, bool includeOthersInTotal)
        {
            PassedTests = summaryItem.GetPassedTestsCount();
            FailedTests = summaryItem.GetFailedTestsCount();
            OtherTests  = summaryItem.GetOtherTestsCount();

            TotalTests = TestResultsHelper.GetTotalTestCountBasedOnUserConfiguration(summaryItem.TestCountByOutCome,
                                                                                     includeOthersInTotal);

            PassingRate = TestResultsHelper.GetTestOutcomePercentageString(PassedTests, TotalTests);

            Duration = TimeSpanFormatter.FormatDurationWithUnit(summaryItem.Duration);

            Url = pipelineConfiguration.TestTabLink;
        }
        public TestInfoByPriorityViewModel(int priority, Dictionary <TestOutcomeForPriority, int> testCountByOutcome,
                                           bool includeOthersInTotal)
        {
            Priority = priority;

            TestCount = TestResultsHelper.GetTotalTestCountBasedOnUserConfiguration(
                testCountByOutcome, includeOthersInTotal);

            if (TestCount > 0)
            {
                var passingTests = GetPassingTestCountByOutcome(testCountByOutcome);

                PassingRate = TestResultsHelper.GetTestOutcomePercentageString(passingTests, TestCount);
            }
        }