コード例 #1
0
        internal void AddQualitySpecificationElement(
            [NotNull] HtmlQualitySpecificationElement element)
        {
            Assert.ArgumentNotNull(element, "issueGroup");

            _elements.Add(element);
        }
コード例 #2
0
        internal void AddQualitySpecificationElement(
            [NotNull] HtmlQualitySpecificationElement element)
        {
            Assert.ArgumentNotNull(element, nameof(element));

            _elements.Add(element);
        }
コード例 #3
0
        internal void AddReferencingElement(
            [NotNull] HtmlQualitySpecificationElement htmlElement)
        {
            Assert.ArgumentNotNull(htmlElement, nameof(htmlElement));

            _referencingElementsDirty = true;
            _referencingElements.Add(htmlElement);
        }
コード例 #4
0
        internal HtmlDatasetReference([NotNull] HtmlQualitySpecificationElement element,
                                      [NotNull] HtmlTestParameterValue parameterValue)
        {
            Assert.ArgumentNotNull(element, nameof(element));
            Assert.ArgumentNotNull(parameterValue, nameof(parameterValue));

            _element        = element;
            _parameterValue = parameterValue;
        }
コード例 #5
0
        private static IEnumerable <HtmlDataQualityCategory> GroupByCategories(
            [NotNull] IEnumerable <QualitySpecificationElement> elements,
            [NotNull] IDictionary <TestDescriptor, HtmlTestDescriptor> testDescriptors,
            [NotNull] HtmlDataQualityCategoryComparer categoryComparer,
            [NotNull] HtmlQualitySpecificationElementComparer elementComparer,
            [CanBeNull] IHtmlDataQualityCategoryOptionsProvider optionsProvider,
            [NotNull] out List <HtmlQualitySpecificationElement>
            htmlQualitySpecificationElements)
        {
            List <QualitySpecificationElement> elementsList = elements.ToList();

            IDictionary <string, HtmlDataQualityCategory> reportCategories =
                MapReportCategories(elementsList,
                                    categoryComparer,
                                    elementComparer,
                                    optionsProvider);

            htmlQualitySpecificationElements = new List <HtmlQualitySpecificationElement>();

            foreach (QualitySpecificationElement element in elementsList)
            {
                HtmlDataQualityCategory reportCategory =
                    reportCategories[GetCategoryKey(element.QualityCondition.Category)];

                HtmlTestDescriptor htmlTestDescriptor =
                    testDescriptors[element.QualityCondition.TestDescriptor];

                var htmlQualityCondition = new HtmlQualityCondition(
                    element.QualityCondition, htmlTestDescriptor, reportCategory);

                var htmlElement = new HtmlQualitySpecificationElement(htmlQualityCondition,
                                                                      element);

                reportCategory.AddQualitySpecificationElement(htmlElement);
                htmlQualitySpecificationElements.Add(htmlElement);

                htmlTestDescriptor.AddReferencingElement(htmlElement);
            }

            htmlQualitySpecificationElements.Sort(elementComparer);

            // exclude undefined root category if it does not contain any quality conditions

            return(reportCategories.Values
                   .Where(cat => !cat.IsRoot ||
                          !cat.IsUndefinedCategory ||
                          cat.QualitySpecificationElements.Count > 0)
                   .Distinct()
                   .OrderBy(c => c, categoryComparer)
                   .ToList());
        }