public override string Export(QualityCondition qualityCondition)
        {
            LineNotNearPolyOverlapConfigurator.Matrix matrix =
                LineNotNearPolyOverlapConfigurator.Convert(qualityCondition);

            return(matrix.ToCsv());
        }
        public override QualityCondition CreateQualityCondition(
            StreamReader file, IList <Dataset> datasets,
            IEnumerable <TestParameterValue> parameterValues)
        {
            Assert.ArgumentNotNull(file, nameof(file));
            Assert.ArgumentNotNull(datasets, nameof(datasets));
            Assert.ArgumentNotNull(parameterValues, nameof(parameterValues));

            var datasetFilter = new Dictionary <Dataset, string>();

            foreach (TestParameterValue oldValue in parameterValues)
            {
                if (oldValue.TestParameterName !=
                    FeatureClassParamName)
                {
                    continue;
                }

                var dsValue = (DatasetTestParameterValue)oldValue;
                if (string.IsNullOrEmpty(dsValue.FilterExpression))
                {
                    continue;
                }

                Dataset dataset = dsValue.DatasetValue;
                Assert.NotNull(dataset, "Dataset parameter {0} does not refer to a dataset",
                               dsValue.TestParameterName);

                datasetFilter.Add(dataset, dsValue.FilterExpression);
            }

            LineNotNearPolyOverlapConfigurator.Matrix mat =
                LineNotNearPolyOverlapConfigurator.Matrix.Create(file);

            var config = new LineNotNearPolyOverlapConfigurator();

            QualityCondition qualityCondition = config.Convert(mat, datasets);

            foreach (TestParameterValue newValue in qualityCondition.ParameterValues)
            {
                if (newValue.TestParameterName !=
                    FeatureClassParamName)
                {
                    continue;
                }

                var     datasetTestParameterValue = (DatasetTestParameterValue)newValue;
                Dataset dataset = datasetTestParameterValue.DatasetValue;

                Assert.NotNull(dataset,
                               "Dataset parameter '{0}' in quality condition '{1}' does not refer to a dataset",
                               datasetTestParameterValue.TestParameterName,
                               qualityCondition.Name);

                if (datasetFilter.TryGetValue(dataset, out string filter))
                {
                    datasetTestParameterValue.FilterExpression = filter;
                }
            }

            return(qualityCondition);
        }