Esempio n. 1
0
        CreateQualityConditionExceptionStatistics(
            [NotNull] IQualityConditionExceptionStatistics statistics)
        {
            var result =
                new XmlQualityConditionExceptions
            {
                QualityConditionName                   = Escape(statistics.QualityCondition.Name),
                ExceptionCount                         = statistics.ExceptionCount,
                ExceptionObjectCount                   = statistics.ExceptionObjectCount,
                UnusedExceptionObjectCount             = statistics.UnusedExceptionObjectCount,
                ExceptionObjectsUsedMultipleTimesCount =
                    statistics.ExceptionObjectUsedMultipleTimesCount
            };

            foreach (ExceptionObject exceptionObject in statistics.UnusedExceptionObjects)
            {
                result.AddUnusedExceptionObject(
                    CreateException(exceptionObject, usageCount: 0));
            }

            foreach (ExceptionUsage usage in statistics.ExceptionObjectsUsedMultipleTimes)
            {
                result.AddExceptionObjectUsedMultipleTimes(
                    CreateException(usage.ExceptionObject, usage.UsageCount));
            }

            foreach (string tableName in statistics.UnknownTableNames)
            {
                ICollection <ExceptionObject> ignored = statistics
                                                        .GetExceptionObjectsInvolvingUnknownTableName(
                    tableName);

                result.ExceptionObjectsIgnoredDueToUnknownTableNameCount = ignored.Count;
                result.AddUnknownTableName(
                    CreateUnknownTableName(tableName, ignored));
            }

            return(result);
        }