Beispiel #1
0
        public OutputFile([NotNull] string filePath)
        {
            Assert.ArgumentNotNullOrEmpty(filePath, nameof(filePath));

            FilePath = filePath;
            FileName = Path.GetFileName(filePath);
            Url      = HtmlReportUtils.GetRelativeUrl(FileName);
        }
Beispiel #2
0
        private List <HtmlExceptionCategoryCount> AggregateExceptionCategories()
        {
            var all = new List <HtmlExceptionCategoryCount>();

            all.AddRange(_issueGroups.SelectMany(ig => ig.ExceptionCategories));
            all.AddRange(_subCategories.SelectMany(sc => sc.ExceptionCategories));

            return(HtmlReportUtils.AggregateExceptionCategoryCounts(all, _exceptionCategories));
        }
        public HtmlReportIssueGroup(
            [NotNull] IssueGroup issueGroup,
            int maximumIssueCount,
            [NotNull] string testIdentifier,
            [NotNull] IEnumerable <HtmlExceptionCategoryCount> htmlExceptionCategoryCounts)
        {
            Assert.ArgumentNotNull(issueGroup, nameof(issueGroup));
            Assert.ArgumentNotNullOrEmpty(testIdentifier, nameof(testIdentifier));
            Assert.ArgumentNotNull(htmlExceptionCategoryCounts,
                                   nameof(htmlExceptionCategoryCounts));
            Assert.ArgumentCondition(issueGroup.IssueCount <= maximumIssueCount,
                                     "Issue count must be <= maximum issue count",
                                     nameof(issueGroup));

            _issueGroup = issueGroup;
            PercentageOfMaximumIssueCount = maximumIssueCount == 0
                                                                ? 0 // zero-width bar will be drawn
                                                                : issueGroup.IssueCount * 100 /
                                            maximumIssueCount;
            ExceptionCategories = htmlExceptionCategoryCounts.ToList();
            ExceptionCount      = issueGroup.ExceptionCount;

            string url = issueGroup.QualityCondition.Url;

            if (url != null && StringUtils.IsNotEmpty(url))
            {
                UrlText = url;
                UrlLink = HtmlReportUtils.GetCompleteUrl(url);
            }

            if (issueGroup.IssueCode != null)
            {
                IssueCode            = issueGroup.IssueCode.ID;
                IssueCodeDescription = issueGroup.IssueCode.Description;
                HasIssueCode         = true;
            }

            string issueDescription = issueGroup.IssueDescription;

            HasIssueDescription = StringUtils.IsNotEmpty(issueDescription);

            Description = HasIssueDescription
                                              ? issueGroup.IssueDescription
                                              : IssueCodeDescription;

            TestIdentifier = testIdentifier;
        }
Beispiel #4
0
        public HtmlReportQualityCondition([NotNull] QualityCondition qualityCondition,
                                          [NotNull] IList <ExceptionCategory> exceptionCategories,
                                          bool isAllowable, bool stopCondtion)
        {
            Assert.ArgumentNotNull(qualityCondition, nameof(qualityCondition));
            Assert.ArgumentNotNull(exceptionCategories, nameof(exceptionCategories));

            _qualityCondition    = qualityCondition;
            _exceptionCategories = exceptionCategories;
            IsAllowable          = isAllowable;
            StopCondtion         = stopCondtion;

            string url = qualityCondition.Url;

            if (url != null && StringUtils.IsNotEmpty(url))
            {
                UrlText = url;
                UrlLink = HtmlReportUtils.GetCompleteUrl(url);
            }
        }