Esempio n. 1
0
        private TestsWithRelatedGeometry CreateTestsWithRelatedGeometry(
            [NotNull] ITable table, [NotNull] IList <ITest> tests,
            [NotNull] IQualityConditionObjectDatasetResolver datasetResolver)
        {
            ITest          testWithTable = tests[0];
            IObjectDataset objectDataset = GetInvolvedObjectDataset(
                table, testWithTable, datasetResolver);

            if (objectDataset == null)
            {
                return(null);
            }

            var relClassChains = GetRelClassChains(
                table, objectDataset, testWithTable,
                out bool hasAnyAssociationsToFeatureClasses);

            var relClassChainTests =
                new TestsWithRelatedGeometry(table, tests, objectDataset, relClassChains);

            relClassChainTests.HasAnyAssociationsToFeatureClasses =
                hasAnyAssociationsToFeatureClasses;

            return(relClassChainTests);
        }
Esempio n. 2
0
        private IList <TestsWithRelatedGeometry> FindTestsWithRelatedGeometry(
            [NotNull] ICollection <ITest> tests,
            [NotNull] IQualityConditionObjectDatasetResolver datasetResolver,
            [NotNull] out IList <ITest> testsWithoutGeometry)
        {
            Assert.ArgumentNotNull(tests, nameof(tests));

            testsWithoutGeometry = new List <ITest>();

            if (tests.Count == 0)
            {
                return(new List <TestsWithRelatedGeometry>());
            }

            Dictionary <ITable, IList <ITest> > testsByTable =
                TestUtils.GetTestsByTable(tests);

            var testsWithRelatedGeometry = new List <TestsWithRelatedGeometry>();

            foreach (KeyValuePair <ITable, IList <ITest> > pair in testsByTable)
            {
                ITable                   table            = pair.Key;
                IList <ITest>            tableTests       = pair.Value;
                TestsWithRelatedGeometry testsWithRelGeom =
                    CreateTestsWithRelatedGeometry(table, tableTests, datasetResolver);
                if (testsWithRelGeom?.HasAnyAssociationsToFeatureClasses == true)
                {
                    testsWithRelatedGeometry.Add(testsWithRelGeom);
                }
                else
                {
                    foreach (ITest test in tableTests)
                    {
                        testsWithoutGeometry.Add(test);
                    }
                }
            }

            return(testsWithRelatedGeometry);
        }